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

50 lines
1.9 KiB

  1. using BPA.Helper;
  2. using BPASmartClient.MorkS.Model;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Collections.ObjectModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. namespace BPASmartClient.MorkS.ViewModel
  11. {
  12. internal class GoodsEditViewModel:NotifyBase
  13. {
  14. private string _orderNum { get; set; }
  15. public string OrderNum { get { return _orderNum; } set { _orderNum = value; OnPropertyChanged(); } }
  16. private string _goodsName="板面";
  17. public string GoodsName { get { return _goodsName; } set { _goodsName = value; OnPropertyChanged(); } }
  18. public ObservableCollection<bool> bowlLocs { get; set; } = new ObservableCollection<bool>() { false, false };
  19. public ObservableCollection<bool> noodlesLocs { get; set; } = new ObservableCollection<bool>() { false, false, false, false, false };
  20. public BPARelayCommand ConfirmCommand { get; set; }
  21. public GoodsEditViewModel()
  22. {
  23. ConfirmCommand = new BPARelayCommand(() => {
  24. GoodsModel goods = new GoodsModel();
  25. goods.OrderNum = Guid.NewGuid().ToString("D");
  26. goods.GoodsName = GoodsName;
  27. var bLoc = bowlLocs.ToList().FindIndex(p => p == true);
  28. var noLoc = noodlesLocs.ToList().FindIndex(p => p == true);
  29. if (bLoc != -1&& noLoc!=-1)
  30. {
  31. goods.BowlLoc = bLoc + 10;
  32. goods.NoodlesLoc = noLoc + 1;
  33. }
  34. else
  35. {
  36. MessageBox.Show("请选择面位置或碗类型", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
  37. return;
  38. }
  39. ActionManage.GetInstance.Send("orderEdit", goods);
  40. ActionManage.GetInstance.Send ("CloseEditWindow");
  41. });
  42. }
  43. }
  44. }