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

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Sevomin.Models.Helpers;
  8. using System.ComponentModel;
  9. namespace Sevomin.Models
  10. {
  11. public class JobViewModel
  12. {
  13. [Key]
  14. public long Id { get; set; }
  15. [Required]
  16. [StringLength(128)]
  17. public string AvalinId { get; set; }
  18. [DisplayName("تاریخ انقضا")]
  19. [DataType(DataType.Date)]
  20. public DateTime ExpireDate { get; set; }
  21. [DisplayName("تاریخ انقضا")]
  22. [DataType(DataType.Date)]
  23. public string JalaliExpireDate
  24. {
  25. get
  26. {
  27. return DateAssist.ToShamsi(this.ExpireDate);
  28. }
  29. set
  30. {
  31. ExpireDate = DateAssist.ValidateAndSetToMiladi(value) ?? DateTime.MinValue;
  32. }
  33. }
  34. [DisplayName("سایر مشخصات")]
  35. public string Description { get; set; }
  36. [DisplayName("نوع رزومه")]
  37. public byte ResumeType { get; set; }
  38. [DisplayName("نام رابط/نماینده شرکت")]
  39. public string ContactPersonName { get; set; }
  40. [DisplayName("تلفن رابط/نماینده شرکت")]
  41. public string ContactPersonPhone { get; set; }
  42. [EmailValidation]
  43. [DisplayName("ایمیل رابط/نماینده شرکت")]
  44. public string ContactPersonEMail { get; set; }
  45. [DisplayName("نمایش نام شرکت")]
  46. public bool ShowCompanyName { get; set; }
  47. [DisplayName("نمایش لوگوی شرکت")]
  48. public bool ShowCompanyLogo { get; set; }
  49. [DisplayName("کار تمام وقت")]
  50. public bool IsFullTime { get; set; }
  51. public IList<JobParameterViewModel> Parameters;
  52. public JobViewModel(Job job)
  53. {
  54. this.Id = job.Id;
  55. this.AvalinId = job.AvalinId;
  56. this.ExpireDate = job.ExpireDate == DateTime.MinValue ? DateTime.Now : job.ExpireDate;
  57. this.Description = job.Description;
  58. this.ResumeType = job.ResumeType;
  59. this.ContactPersonEMail = job.ContactPersonEMail;
  60. this.ContactPersonName = job.ContactPersonName;
  61. this.ContactPersonPhone = job.ContactPersonPhone;
  62. this.ShowCompanyLogo = job.ShowCompanyLogo;
  63. this.ShowCompanyName = job.ShowCompanyName;
  64. this.IsFullTime = job.IsFullTime;
  65. if (job.JobParameters == null)
  66. return;
  67. Parameters = new List<JobParameterViewModel>();
  68. foreach (var jp in job.JobParameters)
  69. {
  70. Parameters.Add(new JobParameterViewModel(jp));
  71. }
  72. }
  73. }
  74. }