SelectSequenceViewModel.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using FurnaceUI.Models;
  8. using MECF.Framework.Common.OperationCenter;
  9. namespace FurnaceUI.Client.Dialog
  10. {
  11. public class SelectSequenceViewModel : FurnaceUIViewModelBase
  12. {
  13. public string _dialogResultString = "";
  14. public string DialogResultString
  15. {
  16. get
  17. {
  18. return _dialogResultString;
  19. }
  20. set
  21. {
  22. _dialogResultString = value;
  23. switch (value)
  24. {
  25. case "Auto":
  26. {
  27. DialogResultView = "Auto";
  28. break;
  29. }
  30. case "Manual_N2Purge":
  31. {
  32. DialogResultView = "Manual(N2Purge)";
  33. break;
  34. }
  35. case "Manual_ATM":
  36. {
  37. DialogResultView = "Manual(ATM)";
  38. break;
  39. }
  40. case "Manual_Maintenance":
  41. {
  42. DialogResultView = "Manual(Maintenance)";
  43. break;
  44. }
  45. case "Auto_Check":
  46. {
  47. DialogResultView = "Auto Check";
  48. break;
  49. }
  50. }
  51. NotifyOfPropertyChange("DialogResultView");
  52. }
  53. }
  54. public string DialogResultView { get; set; }
  55. private string _productZeroStr;
  56. public string ProductZeroStr
  57. {
  58. get => _productZeroStr;
  59. set
  60. {
  61. _productZeroStr = value;
  62. NotifyOfPropertyChange(nameof(ProductZeroStr));
  63. }
  64. }
  65. protected override void OnViewLoaded(object view)
  66. {
  67. base.OnViewLoaded(view);
  68. LoadSetDefaultOption(view);
  69. }
  70. private void LoadSetDefaultOption(object view)
  71. {
  72. }
  73. public void SelectExistClick(string cmd)
  74. {
  75. DialogResultString = cmd;
  76. //if (cmd == "Cancel")
  77. //{
  78. // ((Window)GetView()).DialogResult = false;
  79. //}
  80. //else
  81. //{
  82. // ((Window)GetView()).DialogResult = true;
  83. //}
  84. }
  85. public void OK()
  86. {
  87. if (_dialogResultString == null || _dialogResultString == "")
  88. {
  89. return;
  90. }
  91. ((Window)GetView()).DialogResult = true;
  92. InvokeClient.Instance.Service.DoOperation($"PM1.SetN2PurgeMode", DialogResultString);
  93. }
  94. public void Cancel()
  95. {
  96. ((Window)GetView()).DialogResult = false;
  97. }
  98. }
  99. }