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.

56 lines
1.7 KiB

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. namespace Sevomin.Models
  9. {
  10. public class JobViewModel
  11. {
  12. [Key]
  13. public long Id { get; set; }
  14. [Required]
  15. [StringLength(128)]
  16. public string AvalinId { get; set; }
  17. public DateTime ExpireDate { get; set; }
  18. public string Description { get; set; }
  19. public byte ResumeType { get; set; }
  20. public string ContactPersonName { get; set; }
  21. public string ContactPersonPhone { get; set; }
  22. [EmailValidation]
  23. public string ContactPersonEMail { get; set; }
  24. public bool ShowCompanyName { get; set; }
  25. public bool ShowCompanyLogo { get; set; }
  26. public bool IsFullTime { get; set; }
  27. public IList<JobParameterViewModel> Parameters;
  28. public JobViewModel(Job job)
  29. {
  30. this.Id = job.Id;
  31. this.AvalinId = job.AvalinId;
  32. this.ExpireDate = job.ExpireDate;
  33. this.Description = job.Description;
  34. this.ResumeType = job.ResumeType;
  35. this.ContactPersonEMail = job.ContactPersonEMail;
  36. this.ContactPersonName = job.ContactPersonName;
  37. this.ContactPersonPhone = job.ContactPersonPhone;
  38. this.ShowCompanyLogo = job.ShowCompanyLogo;
  39. this.ShowCompanyName = job.ShowCompanyName;
  40. this.IsFullTime = job.IsFullTime;
  41. Parameters = new List<JobParameterViewModel>();
  42. foreach (var jp in job.JobParameters)
  43. {
  44. Parameters.Add(new JobParameterViewModel(jp));
  45. }
  46. }
  47. }
  48. }