/// <summary> /// 新增基数药品信息 /// </summary> protected void NewDeptRadix() { if (this.tvDeptList.SelectedNode.Parent == null) { return; } int rowCount = this.neuSpread1_Sheet1.Rows.Count; this.neuSpread1_Sheet1.Rows.Add(rowCount, 1); Neusoft.HISFC.Models.Pharmacy.Common.DeptRadix deptRadix = new Neusoft.HISFC.Models.Pharmacy.Common.DeptRadix(); deptRadix.StockDept = this.privDept; deptRadix.Dept = this.radixDept; this.neuSpread1_Sheet1.Rows[rowCount].Tag = deptRadix; this.neuSpread1.Select(); this.neuSpread1_Sheet1.ActiveRowIndex = this.neuSpread1_Sheet1.Rows.Count; this.neuSpread1_Sheet1.ActiveColumnIndex = (int)ColumnSet.ColItemName; this.neuSpread1.StartCellEditing(null, false); this.isNew = true; }
/// <summary> /// 删除科室明细 /// </summary> protected void DelDeptRadixDetail() { if (this.parentNode.Nodes.Count == 0 || this.neuSpread1_Sheet1.Rows.Count == 0) { return; } DialogResult rs = MessageBox.Show(Language.Msg("是否删除该基数药信息?"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (rs == DialogResult.No) { return; } int iRow = this.neuSpread1_Sheet1.ActiveRowIndex; Neusoft.HISFC.Models.Pharmacy.Common.DeptRadix deptRadix = this.neuSpread1_Sheet1.Rows[iRow].Tag as Neusoft.HISFC.Models.Pharmacy.Common.DeptRadix; if (this.phaConsManager.DelDeptRadix(this.privDept.ID, deptRadix.Dept.ID, deptRadix.Item.ID, this.BeginDate) == -1) { MessageBox.Show(Language.Msg("执行删除操作失败")); return; } MessageBox.Show(Language.Msg("删除成功")); this.neuSpread1_Sheet1.Rows.Remove(iRow, 1); if (this.neuSpread1_Sheet1.Rows.Count == 0) { this.parentNode.Nodes.Remove(this.tvDeptList.SelectedNode); } }
/// <summary> /// 加入基数药信息 /// </summary> /// <param name="deptRadix">基数药信息</param> /// <returns>成功返回1 失败返回-1</returns> protected int AddDeptRadixToFp(Neusoft.HISFC.Models.Pharmacy.Common.DeptRadix deptRadix) { this.neuSpread1_Sheet1.Rows.Add(0, 1); this.neuSpread1_Sheet1.Cells[0, (int)ColumnSet.ColItemName].Text = deptRadix.Item.Name; this.neuSpread1_Sheet1.Cells[0, (int)ColumnSet.ColItemSpecs].Text = deptRadix.Item.Specs; this.neuSpread1_Sheet1.Cells[0, (int)ColumnSet.ColUnit].Text = deptRadix.Item.PackUnit; this.neuSpread1_Sheet1.Cells[0, (int)ColumnSet.ColRadixQty].Value = deptRadix.RadixQty; this.neuSpread1_Sheet1.Cells[0, (int)ColumnSet.ColSurplusQty].Value = deptRadix.SurplusQty; this.neuSpread1_Sheet1.Cells[0, (int)ColumnSet.ColSupllyQty].Value = deptRadix.SurplusQty; this.neuSpread1_Sheet1.Cells[0, (int)ColumnSet.ColExpendQty].Value = deptRadix.ExpendQty; this.neuSpread1_Sheet1.Cells[0, (int)ColumnSet.ColMemo].Text = deptRadix.Memo; this.neuSpread1_Sheet1.Cells[0, (int)ColumnSet.ColDrugID].Text = deptRadix.Item.ID; this.neuSpread1_Sheet1.Rows[0].Tag = deptRadix; return(1); }
/// <summary> /// 弹出药品选择 /// </summary> /// <param name="iRowIndex"></param> protected void PopDrug(int iRowIndex) { string[] label = { "编码", "商品名称", "规格" }; float[] width = { 60F, 140F, 100F }; bool[] visible = { false, true, true }; Neusoft.FrameWork.Models.NeuObject speObj = new Neusoft.FrameWork.Models.NeuObject(); if (Neusoft.FrameWork.WinForms.Classes.Function.ChooseItem(this.alItem, ref speObj) == 1) { Neusoft.HISFC.Models.Pharmacy.Common.DeptRadix deptRadix = this.neuSpread1_Sheet1.Rows[iRowIndex].Tag as Neusoft.HISFC.Models.Pharmacy.Common.DeptRadix; deptRadix.Item = speObj as Neusoft.HISFC.Models.Pharmacy.Item; this.neuSpread1_Sheet1.Cells[iRowIndex, (int)ColumnSet.ColItemName].Text = speObj.Name; this.neuSpread1_Sheet1.Cells[iRowIndex, (int)ColumnSet.ColItemSpecs].Text = speObj.Memo; this.neuSpread1_Sheet1.Cells[iRowIndex, (int)ColumnSet.ColDrugID].Text = speObj.ID; this.neuSpread1_Sheet1.Cells[iRowIndex, (int)ColumnSet.ColUnit].Text = deptRadix.Item.PackUnit; this.SetFocus(); } }
/// <summary> /// 保存 /// </summary> protected void SaveDeptRadix() { if (!this.IsValid()) { return; } Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); //Neusoft.FrameWork.Management.Transaction t = new Transaction(Neusoft.FrameWork.Management.Connection.Instance); //t.BeginTransaction(); this.phaConsManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); if (this.phaConsManager.DelDeptRadix(this.privDept.ID, this.radixDept.ID, this.BeginDate) == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(Language.Msg("保存前 删除原科室基数药信息发生错误") + this.phaConsManager.Err); return; } for (int i = 0; i < this.neuSpread1_Sheet1.Rows.Count; i++) { Neusoft.HISFC.Models.Pharmacy.Common.DeptRadix deptRadix = this.neuSpread1_Sheet1.Rows[i].Tag as Neusoft.HISFC.Models.Pharmacy.Common.DeptRadix; if (deptRadix == null || deptRadix.Item.ID == "") { continue; } deptRadix.BeginDate = this.BeginDate; deptRadix.EndDate = this.EndDate; deptRadix.RadixQty = NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColRadixQty].Text); deptRadix.SurplusQty = NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColSurplusQty].Text); deptRadix.SupplyQty = NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColSurplusQty].Text); deptRadix.ExpendQty = NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColExpendQty].Text); deptRadix.Memo = this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColMemo].Text; Neusoft.HISFC.Models.Base.Department dept = interManager.GetDepartment(this.privDept.ID); switch (dept.DeptType.ID.ToString()) { case "T": { deptRadix.DeptType = DrugType.Terminal.ToString(); } break; case "P": { deptRadix.DeptType = DrugType.State.ToString(); } break; case "N": { deptRadix.DeptType = DrugType.Nurse.ToString(); } break; default: { deptRadix.DeptType = DrugType.Nurse.ToString(); break; } } if (this.phaConsManager.InsertDeptRadix(deptRadix) == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); if (this.phaConsManager.DBErrCode == 1) { MessageBox.Show(Language.Msg(deptRadix.Item.Name + "基数信息维护重复 请删除一条")); } else { MessageBox.Show(Language.Msg("插入新基数药信息发生错误") + this.phaConsManager.Err); } return; } } Neusoft.FrameWork.Management.PublicTrans.Commit(); MessageBox.Show(Language.Msg("保存成功")); this.isNew = false; this.InitList(); this.ShowRadixDept(); }