public void AddPurchaseOrderExecute(object parameter)
        {
            PurchaseCargoUserControl          purchaseCargoUserControl   = parameter as PurchaseCargoUserControl;
            PurchaseCargoUserControlViewModel purchaseCargoUserControlvm = purchaseCargoUserControl.DataContext as PurchaseCargoUserControlViewModel;

            PurchaseOrderCollectionViewModel = purchaseCargoUserControlvm.PurchaseOrderCollectionViewModel;
            AddPurchaseOrderWindow          addPurchaseWindow        = new AddPurchaseOrderWindow(CMContext, purchaseCargoUserControlvm.WarehouseRootViewModel);
            AddPurchaseOrderWindowViewModel addPurchaseOrderWindowvm = addPurchaseWindow.DataContext as AddPurchaseOrderWindowViewModel;

            addPurchaseOrderWindowvm.CallBack = new Func <PurchaseOrderViewModel, bool>(CallBack);
            addPurchaseWindow.Show();
        }
 private void AddPurchaseOrderCollectionExecute(object parameter)
 {
     if (OutPurchaseOrderButtonIsEnabled)
     {
         string        message       = "已存在一个订单,无法添加订单";
         string        detailMessage = "同一时间只允许存在一个订单,不允许同一时间编辑两个订单";
         WarningWindow warn          = new WarningWindow(message, detailMessage);
         warn.ShowDialog();
     }
     else
     {
         OutPurchaseOrderButtonIsEnabled  = true;
         PurchaseOrderCollectionViewModel = new PurchaseOrderCollectionViewModel(CMContext);
     }
 }
 public PurchaseOrderViewModel(CargoManagementContext cmContext)
 {
     CMContext      = cmContext;
     PurchaseOrder  = new PurchaseOrder();
     BlockViewModel = new BlockViewModel(CMContext);
     PurchaseOrderCollectionViewModel = new PurchaseOrderCollectionViewModel(CMContext);
     DeletePurchaseOrderCommand       = new DelegateCommand()
     {
         ExecuteAction = new Action <object>(DeletePurchaseOrderExecute)
     };
     ShowDetailCommand = new DelegateCommand()
     {
         ExecuteAction = new Action <object>(ShowDetailExecute)
     };
 }
예제 #4
0
 public PurchaseOrderCollectionDetailWindowViewModel(PurchaseOrderCollectionViewModel pocvm)
 {
     PurchaseOrderCollectionViewModel = pocvm;
 }