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.

47 lines
1.4 KiB

11 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 IList<Tuple<decimal,string>> ParameterValues { get; set; }
  18. public DovominParameterViewModel(DovominParameter dp)
  19. {
  20. StringValue = dp.StringValue;
  21. Id = dp.Id;
  22. ParameterId = dp.Parameter.Id;
  23. DovominId = dp.Dovomin.Id;
  24. ParameterName = dp.Parameter.Name;
  25. HasMoscow = dp.Parameter.Moscow;
  26. DisplayMethod = dp.Parameter.DisplayMethod;
  27. GroupName = dp.Parameter.GroupName;
  28. CommentAvalin = dp.Parameter.CommentAvalin;
  29. CommentDovomin = dp.Parameter.CommentDovomin;
  30. ParameterValues = new List<Tuple<decimal, string>>();
  31. foreach (var val in dp.Parameter.ParameterValues)
  32. {
  33. ParameterValues.Add(new Tuple<decimal, string>(val.NumbericValue, val.Value));
  34. }
  35. }
  36. }
  37. }