终端一体化运控平台
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.

NewShopWindowModel.cs 1.7 KiB

2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using BPA.Helper;
  7. using System.Windows;
  8. using System.IO;
  9. namespace BPASmartClient.ViewModel
  10. {
  11. public class NewShopWindowModel : NotifyBase
  12. {
  13. public NewShopWindowModel()
  14. {
  15. CancelCommand = new BPARelayCommand(() => { ActionManage.GetInstance.Send("CloseWindow"); });
  16. DefineCommand = new BPARelayCommand(() =>
  17. {
  18. DirectoryInfo directoryInfo = new DirectoryInfo(LocaPath.GetInstance().GetDeviceConfigPath);
  19. var files = directoryInfo.GetFiles();
  20. if (files != null && files.FirstOrDefault(p => p.FullName.Contains(ShopName)) != null)
  21. {
  22. ErrorInfo = "已存在该店铺,请重新输入!";
  23. return;
  24. }
  25. ActionManage.GetInstance.Send("ShopPar", new string[] { ShopName, ShopId });
  26. ActionManage.GetInstance.Send("OkCloseWindow");
  27. });
  28. }
  29. //public BPARelayCommand CloseWindowCommand { get; set; }
  30. public BPARelayCommand CancelCommand { get; set; }
  31. public BPARelayCommand DefineCommand { get; set; }
  32. public string ShopName { get { return _mShopName; } set { _mShopName = value; OnPropertyChanged(); } }
  33. private string _mShopName;
  34. public string ShopId { get { return _mShopId; } set { _mShopId = value; OnPropertyChanged(); } }
  35. private string _mShopId;
  36. public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } }
  37. private string _mErrorInfo;
  38. }
  39. }