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

  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 BPA.Helper;
  8. using Microsoft.Toolkit.Mvvm.Messaging;
  9. using System.Windows;
  10. using System.IO;
  11. namespace BPASmartClient.ViewModel
  12. {
  13. public class NewShopWindowModel : NotifyBase
  14. {
  15. public NewShopWindowModel()
  16. {
  17. CancelCommand = new BPARelayCommand(() => { ActionManage.GetInstance.Send("CloseWindow"); });
  18. DefineCommand = new BPARelayCommand(() =>
  19. {
  20. DirectoryInfo directoryInfo = new DirectoryInfo(LocaPath.GetInstance().GetDeviceConfigPath);
  21. var files = directoryInfo.GetFiles();
  22. if (files != null && files.FirstOrDefault(p => p.FullName.Contains(ShopName)) != null)
  23. {
  24. ErrorInfo = "已存在该店铺,请重新输入!";
  25. return;
  26. }
  27. ActionManage.GetInstance.Send("ShopPar", new string[] { ShopName, ShopId });
  28. ActionManage.GetInstance.Send("OkCloseWindow");
  29. });
  30. }
  31. //public BPARelayCommand CloseWindowCommand { get; set; }
  32. public BPARelayCommand CancelCommand { get; set; }
  33. public BPARelayCommand DefineCommand { get; set; }
  34. public string ShopName { get { return _mShopName; } set { _mShopName = value; OnPropertyChanged(); } }
  35. private string _mShopName;
  36. public string ShopId { get { return _mShopId; } set { _mShopId = value; OnPropertyChanged(); } }
  37. private string _mShopId;
  38. public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } }
  39. private string _mErrorInfo;
  40. }
  41. }