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.

52 lines
1.7 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. namespace Sevomin.Models
  4. {
  5. public class JobParameterViewModel
  6. {
  7. public string StringValue { get; private set; }
  8. public byte MoscowValue { get; set; }
  9. public long Id { get; set; }
  10. public long ParameterId { get; set; }
  11. public long JobId { get; set; }
  12. public string AvalinId { get; set; }
  13. public string ParameterName { get; set; }
  14. public bool HasMoscow { get; set; }
  15. public byte DisplayMethod { get; set; }
  16. public string DisplayFormat { get; set; }
  17. public string GroupName { get; set; }
  18. public string CommentAvalin { get; set; }
  19. public string CommentDovomin { get; set; }
  20. public IList<Tuple<decimal,string>> ParameterValues { get; set; }
  21. public JobParameterViewModel(JobParameter jp)
  22. {
  23. StringValue = jp.StringValue;
  24. MoscowValue = jp.Moscow;
  25. Id = jp.Id;
  26. ParameterId = jp.Parameter.Id;
  27. JobId = jp.Job.Id;
  28. AvalinId = jp.Job.Avalin.Id;
  29. ParameterName = jp.Parameter.Name;
  30. HasMoscow = jp.Parameter.Moscow;
  31. DisplayMethod = jp.Parameter.DisplayMethod;
  32. DisplayFormat = jp.Parameter.DisplayFormat;
  33. GroupName = jp.Parameter.GroupName;
  34. CommentAvalin = jp.Parameter.CommentAvalin;
  35. CommentDovomin = jp.Parameter.CommentDovomin;
  36. ParameterValues = new List<Tuple<decimal, string>>();
  37. foreach (var val in jp.Parameter.ParameterValues)
  38. {
  39. ParameterValues.Add(new Tuple<decimal, string>(val.NumbericValue, val.Value));
  40. }
  41. }
  42. }
  43. }