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.

55 lines
1.7 KiB

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