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.6 KiB

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