private void MenuItem_HalfProductIn_Click(object sender, RoutedEventArgs e) { Model_ProductionBookkeeping m = this.DataGrid_ProductionBookkeeping.SelectedCells[0].Item as Model_ProductionBookkeeping; if (m.IsTurn != 0) { MessageBox.Show("此行数据已经添加到半成品仓库中,请勿重复添加!"); return; } else { WarehouseHalpProductModel mm = new WarehouseHalpProductModel(); mm.ProductID = m.ProductGuid; mm.Quantity = m.P4Num; if (new WarehouseHalfProductConsole().Insert(mm) && new ProductionBookkeepingConsole().UpdateTurn(m)) { MessageBox.Show("成功添加" + m.ProductName + "到半成品仓库!"); InitializeData(); HalfProductEvent.OnUpdateDataGrid(); } else { MessageBox.Show("添加失败,请联系管理员!"); } } }
private bool Commit() { _data.Guid = Guid.NewGuid(); _data.OrderType = _inOut; _data.单号 = this.TextBox_Number.Text; _data.备注 = this.TextBox_Remark.Text; _data.单日期 = (((DateTime)this.DatePicker_InsertDate.SelectedDate).Date + DateTime.Now.TimeOfDay).ToString("yyyy-MM-dd HH:mm:ss"); _data.明细 = this.DataGrid_List.ItemsSource as List <Model_圆片仓库>; bool flag = new ViewModel.Orders.Vm_Order_圆片().Add(_data); if (flag) { if (_inOut == 1) { new Helper.SettingFile.INIHelper().IniWriteValue("Other", "圆片入库单", _orderNum.ToString()); } else { new Helper.SettingFile.INIHelper().IniWriteValue("Other", "圆片出库单", _orderNum.ToString()); HalfProductEvent.OnUpdateDataGrid(); } Helper.Events.MeansOfProduction.Event_圆片.OnUpdate圆片订单(); Helper.Events.MeansOfProduction.Event_圆片.OnUpdate圆片库存(); } return(flag); }
private void Button_删除_Click(object sender, RoutedEventArgs e) { if (this.DataGrid_ProcessOut.SelectedCells.Count > 0) { if (MessageBox.Show("确认删除订单?", "警告", MessageBoxButton.YesNo) == MessageBoxResult.No) { return; } ProductManagement_DevlieryModel m = this.DataGrid_ProcessOut.SelectedCells[0].Item as ProductManagement_DevlieryModel; if (new ViewModel.ProductionManagement.DeliveryProcessOutConsole().DeleteOrder(m.Guid)) { InitializeOutsideProcessDataGrid(); HalfProductEvent.OnUpdateDataGrid(); SparePartsInventoryEvent.OnUpdateDataGrid(); DeliveryProcessOutEvent.OnUpdateDataGrid(); } } }
private void RefreshPage() { HalfProductEvent.OnUpdateDataGrid(); SparePartsInventoryEvent.OnUpdateDataGrid(); DeliveryProcessInEvent.OnUpdateDataGrid(); }