终端一体化运控平台
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

55 lignes
1.8 KiB

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