private void tsrbtnNew_Click(object sender, EventArgs e) { try { //生成一个新的单据表头 if (_opType == ConfigManager.OP_YF_PJDB)//平级调拨 张运辉 { _currentMaster = ChangeInmasterToOutmaster(((YP_InMaster)(_billProcessor.BuildNewMaster(_currentDeptId, _currentUserId)))); _currentMaster.OpType = _opType; _currentOrder = ChangeInorderToOutorder((YP_InOrder)(_billProcessor.BuildNewoder(_currentDeptId, ChangeOutmasterToIntmaster(_currentMaster)))); } else { _currentMaster = (YP_OutMaster)(_billProcessor.BuildNewMaster(_currentDeptId, _currentUserId)); _currentMaster.OpType = _opType; _currentOrder = (YP_OutOrder)(_billProcessor.BuildNewoder(_currentDeptId, _currentMaster)); } //加载数据 _outOrderDt = _billQuery.LoadOrder(_currentMaster); this.dgrdOrderInfo.DataSource = _outOrderDt; ClearOrderTextbox(); ShowCurrentMaster(); //设置金额初始值 this.cobOutDate.Focus(); _currentState = ADD; } catch (Exception error) { MessageBox.Show(error.Message); } }
private void FrmInorder_Load(object sender, EventArgs e) { CreateProcessorBySystem(); //如果是添加单据状态 if (_currentState == ADD || _currentState == BACK) { _currentMaster = (YP_InMaster)(_billProcessor.BuildNewMaster(_currentDeptId, _currentUserId)); _currentOrder = (YP_InOrder)(_billProcessor.BuildNewoder(_currentDeptId, _currentMaster)); LoadData(); //设置金额初始值 this.txtStockFee.Text = "0.00"; this.txtStockPrice.Text = "0.000"; this.txtDefStockPrice.Text = "0.000"; } else if (_currentState == UPDATE) { _currentOrder = (YP_InOrder)(_billProcessor.BuildNewoder(_currentDeptId, _currentMaster)); LoadData(); dgrdInOrder_CurrentCellChanged(null, null); } if (_currentMaster.OpType == ConfigManager.OP_YK_BACKSTORE) { this.FormTitle = "退库单据"; } //显示当前表头信息 ShowCurrentMaster(); this.txtSupport.Focus(); }
private void tsrbtnNew_Click(object sender, EventArgs e) { FrmYPAdjOrder frmOrder = new FrmYPAdjOrder(0, _belongSystem); frmOrder.MdiParent = this.MdiParent; frmOrder.WindowState = FormWindowState.Maximized; frmOrder._adjMaster = (YP_AdjMaster)(_billProcessor.BuildNewMaster(_currentDeptId, _currentUserId)); ((GWMHIS.BussinessLogicLayer.Interfaces.IInvokForm) this.Parent.Parent.Parent).AddFormToTabPage(frmOrder); frmOrder.Show(); }
private void FrmYFInorder_Load(object sender, EventArgs e) { try { this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); if (!_isBuildByLimit) { if (_currentState == ADD) { //生成一个新的单据表头 _currentMaster = (YP_InMaster)(_billProcessor.BuildNewMaster(_currentDeptId, _currentUserId)); _currentMaster.SupportDicID = _outDept.DeptID; } _currentOrder = (YP_InOrder)(_billProcessor.BuildNewoder(_currentDeptId, _currentMaster)); LoadData(); } else { _billProcessor.BuildApplyInByStoreLimit(out _currentMaster, out _inOrderDt, (int)_currentDeptId, (int)_currentUserId, _outDept.DeptID, _limitDt); _currentOrder = (YP_InOrder)(_billProcessor.BuildNewoder(_currentDeptId, _currentMaster)); dgrdInOrder.AutoGenerateColumns = false; dgrdInOrder.DataSource = _inOrderDt; _drugInfoDt = _storeQuery.LoadDrugInfo(_outDept.DeptID, (int)_currentDeptId); txtDgCode.SetSelectionCardDataSource(_drugInfoDt); _isBuildByLimit = false; } //显示当前表头信息 this.txtApplyDept.Text = _outDept.DeptName; ShowCurrentMaster(); this.cobBillTime.Focus(); } catch (Exception error) { MessageBox.Show(error.Message); } finally { this.Cursor = DefaultCursor; } }
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 tsrbtnNew_Click(object sender, EventArgs e) { try { //生成一个新的单据表头 _adjMaster = (YP_AdjMaster)(_billProcessor.BuildNewMaster(_adjMaster.DeptID, _adjMaster.RegPeople)); _currentOrder = (YP_AdjOrder)(_billProcessor.BuildNewoder(0, _adjMaster)); //加载数据 LoadData(); ClearOrderTextbox(); ShowMaster(); //设置金额初始值 this.txtNewTrade.Text = "0.00"; this.txtNewRetail.Text = "0.00"; this.txtAdjCode.Focus(); _currentState = ADD; } 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 tsrbtnNewBill_Click(object sender, EventArgs e) { try { if (MessageBox.Show("一旦新增盘点单据,当前库房所有业务都将暂停,您确认要进入盘点状态么?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { if (!ConfigManager.IsChecking(_currentDeptId)) { ConfigManager.BeginCheck(_currentDeptId); } FrmCheckOrder frmcheckOrder = new FrmCheckOrder(_currentUserId, _currentDeptId, _chineseName, _belongSystem); frmcheckOrder.WindowState = FormWindowState.Maximized; frmcheckOrder.MdiParent = this.MdiParent; frmcheckOrder._currentMaster = (YP_CheckMaster)(_billProcessor.BuildNewMaster(_currentDeptId, _currentUserId)); ((GWMHIS.BussinessLogicLayer.Interfaces.IInvokForm) this.Parent.Parent.Parent).AddFormToTabPage(frmcheckOrder); frmcheckOrder.Show(); } } catch (Exception error) { MessageBox.Show(error.Message); } }