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

41 lines
1.4 KiB

  1. using BPA.Helper;
  2. using BPASmartClient.CustomResource.UserControls;
  3. using BPASmartClient.CustomResource.UserControls.MessageShow;
  4. using System.Text;
  5. namespace BPASmartClient.DosingSystem.ViewModel
  6. {
  7. public class CommparSetViewModel : NotifyBase
  8. {
  9. public CommparSetViewModel()
  10. {
  11. SaveCommand = new BPARelayCommand(() =>
  12. {
  13. if (!string.IsNullOrEmpty(CommBaseParModel.NetworkSegAddress))
  14. {
  15. var res = CommBaseParModel.NetworkSegAddress.Split(".");
  16. if (res != null)
  17. {
  18. if (res.Length >= 3)
  19. {
  20. StringBuilder sb = new StringBuilder();
  21. for (int i = 0; i < 3; i++) sb.Append($"{res[i]}.");
  22. Json<DevicePar>.Data.BaseParModel.NetworkSegAddress = sb.ToString();
  23. Json<DevicePar>.Save();
  24. NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"参数保存成功!");
  25. }
  26. }
  27. }
  28. });
  29. }
  30. public BasePar CommBaseParModel { get { return Json<DevicePar>.Data.BaseParModel; } set { Json<DevicePar>.Data.BaseParModel = value; OnPropertyChanged(); } }
  31. //private BasePar _mCommBaseParModel;
  32. public BPARelayCommand SaveCommand { get; set; }
  33. }
  34. }