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.

48 lines
1.1 KiB

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.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.ComponentModel.DataAnnotations;
  7. using System.ComponentModel.DataAnnotations.Schema;
  8. using Sevomin.Models.Helpers;
  9. namespace Sevomin.Models
  10. {
  11. public class Parameter
  12. {
  13. [Key]
  14. public long Id { get; set; }
  15. [Required]
  16. public string Name { get; set; }
  17. [Required]
  18. public bool Moscow { get; set; }
  19. [Required]
  20. public byte DisplayMethod { 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 ICollection<ParameterValue> ParameterValues
  31. {
  32. get
  33. {
  34. return SevominDbContext.Current.ParameterValues.Where(x => x.GroupKey == ParameterValueId).ToList();
  35. }
  36. }
  37. }
  38. }