private void btnAddOrder_Click(object sender, EventArgs e) { try { if (CheckSaveOrder() == true) { txtOutNum_TextChanged(null, null); AddOrderToDT(_currentOrder, _outOrderDt); ClearOrderTextbox(); if (_opType == ConfigManager.OP_YF_PJDB) { _currentOrder = ChangeInorderToOutorder((YP_InOrder)(_billProcessor.BuildNewoder((int)_currentDeptId, ChangeOutmasterToIntmaster(_currentMaster)))); } else { _currentOrder = (YP_OutOrder)(_billProcessor.BuildNewoder((int)_currentDeptId, _currentMaster)); } this.txtDgCode.Focus(); } } catch (Exception error) { MessageBox.Show(error.Message); } }
private void FrmOutOrder_Load(object sender, EventArgs e) { txtApplyPeople.Text = new User(_currentUserId).Name; if (_opType == ConfigManager.OP_YK_REPORTLOSS || _opType == ConfigManager.OP_YF_REPORTLOSS) { txtOpType.Text = "药品报损"; txtOutDept.Text = "无领药科室"; txtOutDept.ReadOnly = true; txtApplyPeople.ReadOnly = true; txtByOptype.ReadOnly = false; } else { this.txtOpType.Text = "科室领药"; txtByOptype.ReadOnly = true; } if (_belongSystem == ConfigManager.YK_SYSTEM) { _billQuery = BillFactory.GetQuery(ConfigManager.DEF_YK_OUT); } else if (_belongSystem == ConfigManager.YF_SYSTEM) { _billQuery = BillFactory.GetQuery(ConfigManager.DEF_YF_OUT); txtBatchNum.ReadOnly = true; } _billProcessor = BillFactory.GetProcessor(_opType); //如果是添加单据状态 if (_currentState == ADD) { //生成一个新的单据表头 _currentMaster = (YP_OutMaster)(_billProcessor.BuildNewMaster(_currentDeptId, _currentUserId)); _currentMaster.OpType = _opType; _currentOrder = (YP_OutOrder)(_billProcessor.BuildNewoder(_currentDeptId, _currentMaster)); LoadData(); } else if (_currentState == UPDATE) { _currentOrder = (YP_OutOrder)(_billProcessor.BuildNewoder(_currentDeptId, _currentMaster)); LoadData(); dgrdOrderInfo_CurrentCellChanged(null, null); } //显示当前表头信息 ShowCurrentMaster(); }
private void btnAddOrder_Click(object sender, EventArgs e) { try { if (CheckSaveOrder() == true) { txtInNum_TextChanged(null, null); AddOrderToDT(_currentOrder, _inOrderDt); ClearOrderTextbox(); _currentOrder = (YP_InOrder)(_billProcessor.BuildNewoder(_currentDeptId, _currentMaster)); this.txtDgCode.Focus(); } } catch (Exception error) { MessageBox.Show(error.Message); } }
private void FrmAdjOrder_Load(object sender, EventArgs e) { try { if (_belongSystem == ConfigManager.YF_SYSTEM) { _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_ADJPRICE); _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YF_ADJPRICE); } else { _billQuery = BillFactory.GetQuery(ConfigManager.OP_YK_ADJPRICE); _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YK_ADJPRICE); } if (_currentState == ADD) { this._currentOrder = (YP_AdjOrder)(_billProcessor.BuildNewoder(0, _adjMaster)); LoadData(); this.txtNewRetail.Text = "0.00"; this.txtNewTrade.Text = "0.00"; ShowMaster(); this.txtAdjCode.Focus(); this.txtAdjCode.SelectAll(); } else { LoadData(); _currentOrder = (YP_AdjOrder)(_billProcessor.BuildNewoder(0, _adjMaster)); dgrdAdjOrder_CurrentCellChanged(null, null); ShowInQuery(); ShowMaster(); } } catch (Exception error) { MessageBox.Show(error.Message); } }
public void BuildNewBill(long deptId, long userId, bool isBuildByLimit) { _currentMaster = (YP_PlanMaster)_billProcessor.BuildNewMaster(deptId, userId); if (!isBuildByLimit) { _orderDt = _billQuery.LoadOrder((BillMaster)_currentMaster); _frmstockplan.RefreshOrder(_orderDt); _currentOrder = (YP_PlanOrder)_billProcessor.BuildNewoder(deptId, _currentMaster); if (_orderDt != null) { _orderDt.Rows.Clear(); } } else { _currentMaster.PlanMasterId = -1; _orderDt = _billQuery.LoadOrder((BillMaster)_currentMaster); _currentMaster.PlanMasterId = 0; _frmstockplan.RefreshOrder(_orderDt); _currentOrder = (YP_PlanOrder)_billProcessor.BuildNewoder(deptId, _currentMaster); } _frmstockplan.ClearAll(); }
private void btnAddOrder_Click(object sender, EventArgs e) { try { ComputeFeeAndNum(); if (CheckSaveOrder() == true) { AddOrderToDT(_currentOrder, _inOrderDt); ClearOrderTextbox(); _currentOrder = (YP_InOrder)(_billProcessor.BuildNewoder(_currentMaster.DeptID, _currentMaster)); //设置金额初始值 this.txtStockFee.Text = "0.00"; this.txtDefStockPrice.Text = "0.000"; this.txtDgCode.Focus(); } } catch (Exception error) { MessageBox.Show(error.Message); } }