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.

51 lines
1.3 KiB

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