终端一体化运控平台
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
1 year ago
2 years ago
1 year ago
2 years ago
2 years 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
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
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. using BPASmartClient.Model;
  10. namespace BPASmartClient.ViewModel
  11. {
  12. public class NewShopWindowModel : NotifyBase
  13. {
  14. public NewShopWindowModel()
  15. {
  16. CancelCommand = new BPARelayCommand(() => { ActionManage.GetInstance.Send("CloseWindow"); });
  17. DefineCommand = new BPARelayCommand(() =>
  18. {
  19. DirectoryInfo directoryInfo = new DirectoryInfo(LocaPath.GetDeviceConfigPath);
  20. var files = directoryInfo.GetFiles();
  21. if (files != null && files.FirstOrDefault(p => p.FullName.Contains(ShopName)) != null)
  22. {
  23. ErrorInfo = "已存在该店铺,请重新输入!";
  24. return;
  25. }
  26. ActionManage.GetInstance.Send(new string[] { ShopName, ShopId }, "ShopPar");
  27. ActionManage.GetInstance.Send("OkCloseWindow");
  28. });
  29. }
  30. //public BPARelayCommand CloseWindowCommand { get; set; }
  31. public BPARelayCommand CancelCommand { get; set; }
  32. public BPARelayCommand DefineCommand { get; set; }
  33. public string ShopName { get { return _mShopName; } set { _mShopName = value; OnPropertyChanged(); } }
  34. private string _mShopName;
  35. public string ShopId { get { return _mShopId; } set { _mShopId = value; OnPropertyChanged(); } }
  36. private string _mShopId;
  37. public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } }
  38. private string _mErrorInfo;
  39. }
  40. }