Ejemplo n.º 1
0
 private void ConfirmExecute(object parameter)
 {
     if (string.IsNullOrWhiteSpace(Warehouse.WarehouseName))
     {
         string        message       = "仓库名称不能为空";
         string        detailMessage = "仓库名称不允许为空";
         WarningWindow warn          = new WarningWindow(message, detailMessage);
         warn.ShowDialog();
     }
     else
     {
         AddWarehouseWindow AddWarehouseWindow = parameter as AddWarehouseWindow;
         bool IsExist = CallBack(Warehouse);
         if (IsExist == true)
         {
             string        message       = "已存在相同名字的仓库";
             string        detailMessage = "仓库名字不允许重复";
             WarningWindow warn          = new WarningWindow(message, detailMessage);
             warn.ShowDialog();
         }
         else
         {
             AddWarehouseWindow.Close();
         }
     }
 }
Ejemplo n.º 2
0
        private void CancelExecute(object parameter)
        {
            Warehouse = null;
            AddWarehouseWindow AddWarehouseWindow = parameter as AddWarehouseWindow;

            CallBack(Warehouse);
            AddWarehouseWindow.Close();
        }
        public void AddWarehouseExecute(object parameter)
        {
            AddWarehouseWindow          addWarehouseWindow   = new AddWarehouseWindow();
            AddWarehouseWindowViewModel AddWarehouseWindowvm = addWarehouseWindow.DataContext as AddWarehouseWindowViewModel;

            AddWarehouseWindowvm.CallBack = new Func <Warehouse, bool>(CallBack);
            addWarehouseWindow.Show();
        }