终端一体化运控平台
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

52 satır
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 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. }