You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

90 lines
2.8 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sevomin.Models.Helpers;
using System.ComponentModel;
namespace Sevomin.Models
{
public class JobViewModel
{
[Key]
public long Id { get; set; }
[Required]
[StringLength(128)]
public string AvalinId { get; set; }
[DisplayName("تاریخ انقضا")]
[DataType(DataType.Date)]
public DateTime ExpireDate { get; set; }
[DisplayName("تاریخ انقضا")]
[DataType(DataType.Date)]
public string JalaliExpireDate
{
get
{
return DateAssist.ToShamsi(this.ExpireDate);
}
set
{
ExpireDate = DateAssist.ValidateAndSetToMiladi(value) ?? DateTime.MinValue;
}
}
[DisplayName("سایر مشخصات")]
public string Description { get; set; }
[DisplayName("نوع رزومه")]
public byte ResumeType { get; set; }
[DisplayName("نام رابط/نماینده شرکت")]
public string ContactPersonName { get; set; }
[DisplayName("تلفن رابط/نماینده شرکت")]
public string ContactPersonPhone { get; set; }
[EmailValidation]
[DisplayName("ایمیل رابط/نماینده شرکت")]
public string ContactPersonEMail { get; set; }
[DisplayName("نمایش نام شرکت")]
public bool ShowCompanyName { get; set; }
[DisplayName("نمایش لوگوی شرکت")]
public bool ShowCompanyLogo { get; set; }
[DisplayName("کار تمام وقت")]
public bool IsFullTime { get; set; }
public IList<JobParameterViewModel> Parameters;
public JobViewModel(Job job)
{
this.Id = job.Id;
this.AvalinId = job.AvalinId;
this.ExpireDate = job.ExpireDate == DateTime.MinValue ? DateTime.Now.AddDays(14) : job.ExpireDate;
this.Description = job.Description;
this.ResumeType = job.ResumeType;
this.ContactPersonEMail = job.ContactPersonEMail;
this.ContactPersonName = job.ContactPersonName;
this.ContactPersonPhone = job.ContactPersonPhone;
this.ShowCompanyLogo = job.ShowCompanyLogo;
this.ShowCompanyName = job.ShowCompanyName;
this.IsFullTime = job.IsFullTime;
if (job.JobParameters == null)
return;
Parameters = new List<JobParameterViewModel>();
foreach (var jp in job.JobParameters)
{
Parameters.Add(new JobParameterViewModel(jp));
}
}
}
}