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.

46 lines
1.5 KiB

10 years ago
10 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Sevomin.Models
  4. {
  5. public class DovominParameterViewModel
  6. {
  7. public string StringValue { get; private set; }
  8. public long Id { get; set; }
  9. public long ParameterId { get; set; }
  10. public string DovominId { get; set; }
  11. public string ParameterName { get; set; }
  12. public bool HasMoscow { get; set; }
  13. public byte DisplayMethod { get; set; }
  14. public string GroupName { get; set; }
  15. public string CommentAvalin { get; set; }
  16. public string CommentDovomin { get; set; }
  17. public bool IsNumeric { get; set; }
  18. public IList<Tuple<decimal, string>> ParameterValues { get; set; }
  19. public DovominParameterViewModel(DovominParameter dp)
  20. {
  21. StringValue = dp.StringValue;
  22. Id = dp.Id;
  23. ParameterId = dp.Parameter.Id;
  24. DovominId = dp.Dovomin.Id;
  25. ParameterName = dp.Parameter.Name;
  26. HasMoscow = dp.Parameter.Moscow;
  27. DisplayMethod = dp.Parameter.DisplayMethod;
  28. GroupName = dp.Parameter.GroupName;
  29. CommentAvalin = dp.Parameter.CommentAvalin;
  30. CommentDovomin = dp.Parameter.CommentDovomin;
  31. ParameterValues = new List<Tuple<decimal, string>>();
  32. foreach (var val in dp.Parameter.ParameterValues)
  33. {
  34. ParameterValues.Add(new Tuple<decimal, string>(val.NumbericValue, val.Value));
  35. }
  36. }
  37. }
  38. }