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.

54 lines
1.5 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. using System.Collections.Generic;
  2. using System.ComponentModel;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. using System.Linq;
  6. using Sevomin.Models.Enums;
  7. namespace Sevomin.Models
  8. {
  9. public class Parameter
  10. {
  11. [Key]
  12. public long Id { get; set; }
  13. [Required]
  14. public string Name { get; set; }
  15. [Required]
  16. public bool Moscow { get; set; }
  17. [Required]
  18. public byte DisplayMethod { get; set; }
  19. [StringLength(50)]
  20. public string DisplayFormat { get; set; }
  21. [Required]
  22. public string GroupName { get; set; }
  23. [StringLength(140)]
  24. public string CommentAvalin { get; set; }
  25. [StringLength(140)]
  26. public string CommentDovomin { get; set; }
  27. [StringLength(50)]
  28. public string ParameterValueId { get; set; }
  29. [NotMapped]
  30. public IQueryable<ParameterValue> ParameterValues
  31. {
  32. get
  33. {
  34. return SevominDbContext.Current.ParameterValues.Where(x => x.GroupKey == ParameterValueId);
  35. }
  36. }
  37. public int BasePoint { get; set; }
  38. public virtual ICollection<JobParameter> JobParameters { get; set; }
  39. public virtual ICollection<DovominParameter> DovominParameters { get; set; }
  40. [DefaultValue(ParameterType.Text)]
  41. public ParameterType ParameterType { get; set; }
  42. }
  43. }