LotCompleteDialogViewModel.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System.Windows;
  2. using MECF.Framework.Common.CommonData;
  3. using OpenSEMI.ClientBase;
  4. namespace VirgoUI.Client.Models.Operate.WaferAssociation
  5. {
  6. public class ModuleLotCompleteItem : NotifiableItem
  7. {
  8. public string Module { get; set; }
  9. public string LotID { get; set; }
  10. public string WaferSize { get; set; }
  11. public string WaferNumber { get; set; }
  12. public string StartTime { get; set; }
  13. public string EndTime { get; set; }
  14. public void Clear()
  15. {
  16. Module = "";
  17. LotID = "";
  18. WaferSize = "";
  19. WaferNumber = "";
  20. StartTime = "";
  21. EndTime = "";
  22. }
  23. }
  24. public class LotCompleteDialogViewModel : DialogViewModel<string>
  25. {
  26. public bool IsDisplayed { get; set; }
  27. public ModuleLotCompleteItem LP1LotComplete { get; set; }
  28. public ModuleLotCompleteItem LP2LotComplete { get; set; }
  29. public Visibility LP1Visibility { get; set; }
  30. public Visibility LP2Visibility { get; set; }
  31. public LotCompleteDialogViewModel()
  32. {
  33. LP1LotComplete = new ModuleLotCompleteItem();
  34. LP2LotComplete = new ModuleLotCompleteItem();
  35. LP1Visibility = Visibility.Hidden;
  36. LP2Visibility = Visibility.Hidden;
  37. }
  38. public void SetVisible(string module, bool isVisible)
  39. {
  40. if (module == "LP1")
  41. {
  42. LP1Visibility = isVisible ? Visibility.Visible : Visibility.Hidden;
  43. NotifyOfPropertyChange(nameof(LP1Visibility));
  44. }
  45. if (module == "LP2")
  46. {
  47. LP2Visibility = isVisible ? Visibility.Visible : Visibility.Hidden;
  48. NotifyOfPropertyChange(nameof(LP2Visibility));
  49. }
  50. }
  51. public void OK()
  52. {
  53. IsCancel = false;
  54. IsDisplayed = false;
  55. SetVisible("LP1", false);
  56. SetVisible("LP2", false);
  57. TryClose(true);
  58. }
  59. }
  60. }