/// <summary> /// 初始化医嘱批次信息 /// </summary> /// <returns></returns> private int InitOrderGroup() { Neusoft.HISFC.BizLogic.Pharmacy.Constant consManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); List <Neusoft.HISFC.Models.Pharmacy.OrderGroup> orderGroupList = consManager.QueryOrderGroup(); if (orderGroupList == null) { MessageBox.Show(Language.Msg("获取医嘱批次信息发生错误")); return(-1); } string[] strOrderGroup = new string[orderGroupList.Count + 1]; strOrderGroup[0] = "全部"; int i = 1; foreach (Neusoft.HISFC.Models.Pharmacy.OrderGroup info in orderGroupList) { strOrderGroup[i] = info.ID; i++; } this.cmbOrderGroup.Items.AddRange(strOrderGroup); string orderGroup = consManager.GetOrderGroup(consManager.GetDateTimeFromSysDateTime()); if (orderGroup != "") { this.cmbOrderGroup.Text = orderGroup; } return(1); }
/// <summary> /// 药柜处理 /// </summary> private void SetArkDept(ref Neusoft.FrameWork.Models.NeuObject operDept) { Neusoft.HISFC.BizLogic.Pharmacy.Constant phaConsManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.Models.Pharmacy.DeptConstant deptCons = phaConsManager.QueryDeptConstant(operDept.ID); if (deptCons == null) { MessageBox.Show(Language.Msg("根据科室编码获取科室常数信息发生错误") + phaConsManager.Err); return; } if (deptCons.IsArk) //对药柜管理科室进行以下处理 { Neusoft.HISFC.BizProcess.Integrate.Manager managerIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Manager(); ArrayList al = managerIntegrate.LoadPhaParentByChildren(operDept.ID); if (al == null || al.Count == 0) { MessageBox.Show(Language.Msg("获取科室结构信息发生错误") + managerIntegrate.Err); return; } Neusoft.HISFC.Models.Base.DepartmentStat deptStat = al[0] as Neusoft.HISFC.Models.Base.DepartmentStat; if (deptStat.PardepCode.Substring(0, 1) == "S") //上级节点为分类编码 不进行处理 { return; } else { operDept.ID = deptStat.PardepCode; operDept.Name = deptStat.PardepName; } } }
//protected override void OnLoad() //{ // this.Init(); // base.OnLoad(); //} /// <summary> /// 供货公司treeview /// </summary> /// <returns></returns> protected override int OnDrawTree() { if (this.tvLeft == null) { return(-1); } Neusoft.HISFC.BizLogic.Pharmacy.Constant pha = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); ArrayList deptList = pha.QueryCompany("1"); if (deptList == null) { return(-1); } TreeNode parentTreeNode = new TreeNode("所有公司"); this.tvLeft.Nodes.Add(parentTreeNode); foreach (Neusoft.HISFC.Models.Pharmacy.Company dept in deptList) { TreeNode deptNode = new TreeNode(); deptNode.Tag = dept.ID; deptNode.Text = dept.Name; parentTreeNode.Nodes.Add(deptNode); } parentTreeNode.ExpandAll(); return(base.OnDrawTree()); }
/// <summary> /// 目标单位信息填充 /// </summary> /// <param name="targetNO">目标单位编码</param> private int FillTargetInfo(string targetNO) { if (this.isPIDept) //药库 { Neusoft.HISFC.BizLogic.Pharmacy.Constant phaConsManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.Models.Pharmacy.Company company = phaConsManager.QueryCompanyByCompanyID(targetNO); if (company == null) { MessageBox.Show(Language.Msg("无法获取该条供货单位信息")); return(-1); } this.phaInManager.TargetDept = company; this.phaInManager.TargetDept.Memo = "1"; } else { Neusoft.HISFC.BizLogic.Manager.Department deptManager = new Neusoft.HISFC.BizLogic.Manager.Department(); Neusoft.HISFC.Models.Base.Department dept = deptManager.GetDeptmentById(targetNO); if (dept == null) { MessageBox.Show(Language.Msg("无法获取该条记录申请科室信息!")); return(-1); } this.phaInManager.TargetDept = dept; this.phaInManager.TargetDept.Memo = "0"; } return(1); }
/// <summary> /// 初始化 /// </summary> /// <returns>成功返回1 失败返回-1</returns> protected int Init() { Neusoft.HISFC.BizLogic.Pharmacy.Constant consManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); ArrayList alProduce = consManager.QueryCompany("0"); if (alProduce == null) { MessageBox.Show(Language.Msg("获取生产厂家列表发生错误" + consManager.Err)); return(-1); } this.produceHelper = new Neusoft.FrameWork.Public.ObjectHelper(alProduce); this.privDept = ((Neusoft.HISFC.Models.Base.Employee)consManager.Operator).Dept; Neusoft.HISFC.BizProcess.Integrate.Manager managerIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Manager(); ArrayList alDept = managerIntegrate.GetDeptmentAllValid(); this.deptHelpre = new Neusoft.FrameWork.Public.ObjectHelper(alDept); this.InitDataSet(); DateTime sysTime = consManager.GetDateTimeFromSysDateTime(); this.dtpEnd.Value = sysTime.Date.AddDays(1); this.dtpBegin.Value = sysTime.Date.AddDays(-7); this.tvPatient.ImageList = this.tvPatient.deptImageList; return(1); }
/// <summary> /// 初始化数据 /// </summary> private void InitData() { this.privOper = this.dataManager.Operator; List <Neusoft.FrameWork.Models.NeuObject> alPriv = Neusoft.HISFC.Components.Common.Classes.Function.QueryPrivList("0330", true); if (alPriv != null && alPriv.Count != 0) { this.BeginTime = this.dataManager.GetDateTimeFromSysDateTime().Date.AddYears(-1); this.EndTime = this.dataManager.GetDateTimeFromSysDateTime(); } #region 获取帮助类 Neusoft.HISFC.BizLogic.Pharmacy.Constant phaCons = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); ArrayList alCompany = phaCons.QueryCompany("1"); if (alCompany != null) { this.companyHelper = new Neusoft.FrameWork.Public.ObjectHelper(alCompany); } ArrayList alProduce = phaCons.QueryCompany("0"); if (alProduce != null) { this.producHelper = new Neusoft.FrameWork.Public.ObjectHelper(alProduce); } #endregion this.numFpCellType.DecimalPlaces = 4; this.BeginTime = this.dataManager.GetDateTimeFromSysDateTime().Date.AddDays(-7); this.EndTime = this.dataManager.GetDateTimeFromSysDateTime().Date.AddDays(1); }
/// <summary> /// 数据初始化 /// </summary> protected void Init() { ArrayList al = new ArrayList(); #region 银行 Neusoft.HISFC.BizLogic.Manager.Constant constantManager = new Neusoft.HISFC.BizLogic.Manager.Constant(); al = constantManager.GetList("BANK"); if (al == null) { MessageBox.Show(Language.Msg("获取银行列表失败" + constantManager.Err)); return; } bankHelper.ArrayObject = al; #endregion #region 人员 Neusoft.HISFC.BizLogic.Manager.Person personManager = new Neusoft.HISFC.BizLogic.Manager.Person(); al = personManager.GetEmployeeAll(); if (al == null) { MessageBox.Show(Language.Msg("获取所有人员列表" + personManager.Err)); return; } this.personHelper.ArrayObject = al; #endregion #region 供货单位 Neusoft.HISFC.BizLogic.Pharmacy.Constant constant = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); this.alCompany = constant.QueryCompany("1"); if (this.alCompany == null) { MessageBox.Show(constant.Err); return; } //{49390DE5-B54F-4b15-A012-208CDF288FF5} 可选择全部供货公司 增加银行列表选择功能 Neusoft.HISFC.Models.Pharmacy.Company rootCompany = new Neusoft.HISFC.Models.Pharmacy.Company(); rootCompany.ID = "AAAA"; rootCompany.Name = "全部供货公司"; this.alCompany.Insert(0, rootCompany); this.companyHelper = new Neusoft.FrameWork.Public.ObjectHelper(this.alCompany); #endregion Neusoft.FrameWork.Management.DataBaseManger dataBaseManager = new Neusoft.FrameWork.Management.DataBaseManger(); DateTime sysTime = dataBaseManager.GetDateTimeFromSysDateTime().Date.AddDays(1); this.dtBegin = sysTime.AddDays(-30); this.dtEnd = sysTime; this.privOper = dataBaseManager.Operator; this.payFlag = "'0','1'"; }
/// <summary> /// 药柜处理 /// </summary> private void SetArkDept(ref Neusoft.FrameWork.Models.NeuObject operDept) { Neusoft.HISFC.BizLogic.Pharmacy.Constant phaConsManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.Models.Pharmacy.DeptConstant deptCons = phaConsManager.QueryDeptConstant(operDept.ID); if (deptCons == null) { MessageBox.Show(Language.Msg("根据科室编码获取科室常数信息发生错误") + phaConsManager.Err); return; } operDept.Memo = Neusoft.FrameWork.Function.NConvert.ToInt32(deptCons.IsArk).ToString(); if (this.tvDrugMessage1.StockMarkDept == null || (this.tvDrugMessage1.StockMarkDept.ID != operDept.ID)) { this.tvDrugMessage1.StockMarkDept = operDept.Clone(); } if (deptCons.IsArk) //对药柜管理科室进行以下处理 { #region 药柜处理 Neusoft.HISFC.BizProcess.Integrate.Manager managerIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Manager(); ArrayList al = managerIntegrate.LoadPhaParentByChildren(operDept.ID); if (al == null || al.Count == 0) { MessageBox.Show(Language.Msg("获取科室结构信息发生错误") + managerIntegrate.Err); return; } Neusoft.HISFC.Models.Base.DepartmentStat deptStat = al[0] as Neusoft.HISFC.Models.Base.DepartmentStat; if (deptStat.PardepCode.Substring(0, 1) == "S") //上级节点为分类编码 不进行处理 { return; } else { this.ucDrugDetail1.ArkDept = operDept.Clone(); this.ucDrugMessage1.ArkDept = operDept.Clone(); //核准扣库科室为药柜所属药房 this.ucDrugDetail1.ApproveDept = new Neusoft.FrameWork.Models.NeuObject(); this.ucDrugDetail1.ApproveDept.ID = deptStat.PardepCode; this.ucDrugDetail1.ApproveDept.Name = deptStat.PardepName; this.ucDrugMessage1.ApproveDept = new Neusoft.FrameWork.Models.NeuObject(); this.ucDrugMessage1.ApproveDept.ID = deptStat.PardepCode; this.ucDrugMessage1.ApproveDept.Name = deptStat.PardepName; operDept.ID = deptStat.PardepCode; operDept.Name = deptStat.PardepName; } #endregion this.isArkDept = true; } }
/// <summary> /// 初始化 /// </summary> public virtual void Init() { Neusoft.HISFC.BizLogic.Pharmacy.Constant phaConsManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); this.alCompany = phaConsManager.QueryCompany("1"); if (this.alCompany == null) { MessageBox.Show(Language.Msg("获取供货公司列表发生错误") + phaConsManager.Err); return; } this.neuSpread1_Sheet1.Columns[0].Locked = true; this.neuSpread1_Sheet1.Columns[2].Locked = true; }
/// <summary> /// 判断某科室是否为药柜 /// </summary> /// <param name="deptCode">科室编码</param> /// <returns>成功返回1 失败返回-1</returns> private bool ArkJudge(string deptCode) { Neusoft.HISFC.BizLogic.Pharmacy.Constant phaConsManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.Models.Pharmacy.DeptConstant deptCons = phaConsManager.QueryDeptConstant(deptCode); if (deptCons == null) { MessageBox.Show(Language.Msg("根据科室编码获取科室常数信息失败") + phaConsManager.Err); return(false); } return(deptCons.IsArk); }
/// <summary> /// 入库单据查询 /// </summary> protected override void QueryIn() { Neusoft.HISFC.BizLogic.Pharmacy.Item itemManager = new Neusoft.HISFC.BizLogic.Pharmacy.Item(); ArrayList alList = itemManager.QueryInputList(this.DeptInfo.ID, "AAAA", this.State, this.BeginDate, this.EndDate); if (alList == null) { MessageBox.Show(Language.Msg("查询单据列表发生错误" + itemManager.Err)); } this.neuSpread1_Sheet1.Rows.Count = 0; foreach (Neusoft.HISFC.Models.Pharmacy.Input info in alList) { if (this.MarkPrivType != null) { if (this.MarkPrivType.ContainsKey(info.PrivType)) //对于过滤的权限不显示 { continue; } } this.neuSpread1_Sheet1.Rows.Add(0, 1); this.neuSpread1_Sheet1.Cells[0, 0].Text = info.InListNO; this.neuSpread1_Sheet1.Cells[0, 1].Text = info.DeliveryNO; this.neuSpread1_Sheet1.Cells[0, 2].Text = this.inTypeHelper.GetName(info.PrivType); Neusoft.HISFC.Models.Pharmacy.Company company = new Neusoft.HISFC.Models.Pharmacy.Company(); if (info.Company.ID != "None") { Neusoft.HISFC.BizLogic.Pharmacy.Constant constant = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); company = constant.QueryCompanyByCompanyID(info.Company.ID); if (company == null) { MessageBox.Show(Language.Msg(constant.Err)); return; } } else { company.ID = "None"; company.Name = "无供货公司"; } this.neuSpread1_Sheet1.Cells[0, 3].Text = company.Name; this.neuSpread1_Sheet1.Cells[0, (int)ColumnSet.ColTargetID].Text = company.ID; } }
/// <summary> /// 模版选择 /// </summary> /// <param name="privDept">权限科室</param> /// <param name="openType">模版类型</param> /// <remarks>{037D86BC-5E18-41dd-8D34-16D89C426B88}公开该方法,用于代码本地化时可以调用</remarks> /// <returns>成功返回模版信息 失败返回null</returns> public static ArrayList ChooseDrugStencil(string privDept, Neusoft.HISFC.Models.Pharmacy.EnumDrugStencil stencilType) { Neusoft.HISFC.BizLogic.Pharmacy.Constant consManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); ArrayList alList = consManager.QueryDrugStencilList(privDept, stencilType); if (alList == null) { System.Windows.Forms.MessageBox.Show(Language.Msg("获取该类型模版发生错误" + consManager.Err)); return(null); } if (alList.Count == 0) { System.Windows.Forms.MessageBox.Show(Language.Msg("无该类型模版数据")); return(null); } ArrayList alSelect = new ArrayList(); Neusoft.FrameWork.Models.NeuObject selectObj = new Neusoft.FrameWork.Models.NeuObject(); foreach (Neusoft.HISFC.Models.Pharmacy.DrugStencil temp in alList) { selectObj = new Neusoft.FrameWork.Models.NeuObject(); selectObj.ID = temp.Stencil.ID; selectObj.Name = temp.Stencil.Name; selectObj.Memo = temp.OpenType.Name; alSelect.Add(selectObj); } string[] label = { "模版编码", "模版名称", "模版类型" }; float[] width = { 60F, 100F, 120F }; bool[] visible = { true, true, true, false, false, false }; if (Neusoft.FrameWork.WinForms.Classes.Function.ChooseItem(alSelect, ref selectObj) == 0) { return(new ArrayList()); } else { ArrayList alOpenDetail = new ArrayList(); alOpenDetail = consManager.QueryDrugStencil(selectObj.ID); if (alOpenDetail == null) { System.Windows.Forms.MessageBox.Show(Language.Msg(consManager.Err)); return(null); } return(alOpenDetail); } }
private void Init() { Neusoft.HISFC.BizLogic.Pharmacy.Constant phaConsManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); this.alCompany = phaConsManager.QueryCompany("1"); if (this.alCompany == null) { MessageBox.Show("获取供货单位列表发生错误"); return; } this.companyHerlper = new Neusoft.FrameWork.Public.ObjectHelper(this.alCompany); this.deptInfo = ((Neusoft.HISFC.Models.Base.Employee)phaConsManager.Operator).Dept; }
/// <summary> /// 根据所赋值的库房编码 设置信息显示 /// </summary> public void SetData() { Neusoft.HISFC.BizLogic.Pharmacy.Constant consMgr = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.Models.Pharmacy.DeptConstant deptCons = consMgr.QueryDeptConstant(this.deptCode); if (deptCons == null) { MessageBox.Show(Language.Msg("获取科室常数发生错误! \n" + consMgr.Err)); return; } this.dtpEnd.Value = consMgr.GetDateTimeFromSysDateTime().Date.AddDays(1).AddSeconds(-1); this.dtpBegin.Value = this.dtpEnd.Value.AddDays(-deptCons.ReferenceDays); this.txtMaxDays.Text = deptCons.StoreMaxDays.ToString(); this.txtMinDays.Text = deptCons.StoreMinDays.ToString(); this.lbIntervalDays.Text = deptCons.ReferenceDays.ToString() + "天"; }
/// <summary> /// 初始化 /// </summary> public virtual void Init() { if (!isInit) { this.ucDrugList1.ShowPharmacyList(); //加载药品列表 Neusoft.HISFC.BizLogic.Manager.Constant consManager = new Neusoft.HISFC.BizLogic.Manager.Constant(); System.Collections.ArrayList alInvoiceType = consManager.GetList("InvoiceType"); this.cmbInvoiceType.AddItems(alInvoiceType); Neusoft.HISFC.BizLogic.Pharmacy.Constant phaCons = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); System.Collections.ArrayList alProduce = phaCons.QueryCompany("0"); this.cmbProduce.AddItems(alProduce); isInit = true; //已进行了初始化 } }
/// <summary> /// 查询药品列表 by Sunjh 2008-09-22 /// </summary> /// <param name="fCode">药理作用代码</param> /// <param name="fLevl">药理作用分级</param> private void ShowDrugList(string fCode, int fLevl) { if (fCode == "" || fCode == null) { return; } Neusoft.HISFC.BizLogic.Pharmacy.Constant cItem = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); List <Neusoft.HISFC.Models.Pharmacy.Item> al = cItem.QueryItemListByFunctionID(fCode, 1); if (al != null) { this.PutList(al); } else { fpDrugList.RowCount = 0; } }
/// <summary> /// 增加申请数据 /// </summary> /// <param name="listCode">申请单号</param> /// <param name="state">状态</param> /// <returns>成功返回1 </失败返回-1returns> protected virtual int AddApplyData(string listCode, string state) { Neusoft.HISFC.BizLogic.Pharmacy.Item itemManager = new Neusoft.HISFC.BizLogic.Pharmacy.Item(); ArrayList al = itemManager.QueryApplyIn(this.phaInManager.DeptInfo.ID, listCode, "0"); if (al == null) { System.Windows.Forms.MessageBox.Show(Language.Msg("未正确获取外部入库申请信息" + itemManager.Err)); return(-1); } this.Clear(); Neusoft.FrameWork.Models.NeuObject applyCompany = new Neusoft.FrameWork.Models.NeuObject(); foreach (Neusoft.HISFC.Models.Pharmacy.Input input in al) { Neusoft.HISFC.Models.Pharmacy.Item tempItem = itemManager.GetItem(input.Item.ID); input.Item = tempItem; //药品实体信息 input.Quantity = input.Operation.ApplyQty; if (this.AddDataToTable(input) == 1) { this.hsInputData.Add(input.Item.ID + input.BatchNO, input); } applyCompany = input.Company; } Neusoft.HISFC.BizLogic.Pharmacy.Constant consManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.Models.Pharmacy.Company compay = consManager.QueryCompanyByCompanyID(applyCompany.ID); applyCompany.Name = compay.Name; applyCompany.Memo = "1"; this.phaInManager.TargetDept = applyCompany; this.CompuateSum(); this.SetFormat(); return(1); }
/// <summary> /// 生成药理作用DataView,用于根据父节点过虑子节点 /// </summary> /// <returns></returns> private DataView CreateDataView() { Neusoft.HISFC.BizLogic.Pharmacy.Constant pharmacyConstant = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); DataTable myDataTable = new DataTable("tbFunction"); DataRow myDataRow; myDataTable.Columns.Add("NODE_CODE", typeof(String)); myDataTable.Columns.Add("PARENT_NODE", typeof(String)); myDataTable.Columns.Add("NODE_NAME", typeof(String)); myDataTable.Columns.Add("NODE_KIND", typeof(int)); foreach (Neusoft.HISFC.Models.Pharmacy.PhaFunction phafun in pharmacyConstant.QueryPhaFunction()) { myDataRow = myDataTable.NewRow(); myDataRow["PARENT_NODE"] = phafun.ParentNode; myDataRow["NODE_CODE"] = phafun.ID; myDataRow["NODE_NAME"] = phafun.Name; myDataRow["NODE_KIND"] = phafun.NodeKind; myDataTable.Rows.Add(myDataRow); } DataView custDV = new DataView(myDataTable); return(custDV); }
private static string GetCompoundGroup(DateTime useTime) { if (orderGroupList == null) { Neusoft.HISFC.BizLogic.Pharmacy.Constant consManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); orderGroupList = consManager.QueryOrderGroup(); } DateTime juegeTime = new DateTime(2000, 12, 12, useTime.Hour, useTime.Minute, useTime.Second); if (orderGroupList != null) { foreach (Neusoft.HISFC.Models.Pharmacy.OrderGroup info in orderGroupList) { if (juegeTime >= info.BeginTime && juegeTime <= info.EndTime) { return(info.ID); } } } return(""); }
public void Save() { this.phaOutManager.Fp.StopCellEditing(); if (!this.Valid()) { return; } DialogResult rs = MessageBox.Show(Language.Msg("确认向" + this.phaOutManager.TargetDept.Name + "进行出库操作吗?"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (rs == DialogResult.No) { return; } this.dt.DefaultView.RowFilter = "1=1"; for (int i = 0; i < this.dt.DefaultView.Count; i++) { this.dt.DefaultView[i].EndEdit(); } DataTable dtAddMofity = this.dt.GetChanges(DataRowState.Added | DataRowState.Modified); if (dtAddMofity == null || dtAddMofity.Rows.Count <= 0) { return; } this.phaOutManager.Fp.StopCellEditing(); Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在进行保存操作..请稍候"); System.Windows.Forms.Application.DoEvents(); #region 事务定义 Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); Neusoft.HISFC.BizLogic.Pharmacy.Constant phaCons = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.BizProcess.Integrate.Pharmacy phaIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy(); //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance); //t.BeginTransaction(); this.itemManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); //phaIntegrate.SetTrans(t.Trans); //phaCons.SetTrans(t.Trans); #endregion DateTime sysTime = this.itemManager.GetDateTimeFromSysDateTime(); string outListNO = ""; string inListNO = ""; //判断领用科室是否管理库存 bool isManagerStore = phaCons.IsManageStore(this.phaOutManager.TargetDept.ID); //如管理库存 则提示是否确认保存出库 if (isManagerStore) { Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); DialogResult rsResult = MessageBox.Show(Language.Msg(this.phaOutManager.TargetDept.Name + "管理库存。确认进行出库操作吗?\n出库时将直接更新对方库存"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (rsResult == DialogResult.No) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); return; } Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在进行保存操作..请稍候"); System.Windows.Forms.Application.DoEvents(); } //一般出库对应的入库记录 Neusoft.HISFC.Models.Pharmacy.Input input = null; //-------原程序处理方式 // //如领用科室管理库存 则只处理出库记录、更新本科室库存 不处理入库记录和领药科室库存 待领药科室入库核准后才处理库存 // //如领药科室不管理库存 则处理出库记录、更新本科室库存,试用期间处理入库记录、更新领药科室库存 // // 正式使用后不处理入库记录和领药科室库存 // //只需对isManagerStore赋值改变 对下边入库记录处理的判断做下修改即可 // //更新领药科室库存的操作封装于入库函数内 和入库记录一同处理 可通过传入参数判断是否处理库存 //-------新程序处理方式 // 一般出库时,不管目标科室是不是管理库存,都直接设置出库记录状态为已核准。 // 目标科室管理库存时,对目标科室产生入库记录,状态为已核准 // 目标科室不管理库存时,对目标科室不产生入库记录 this.alPrintData = new ArrayList(); foreach (DataRow dr in dtAddMofity.Rows) { string key = dr["药品编码"].ToString() + dr["批号"].ToString(); Neusoft.HISFC.Models.Pharmacy.Output output = this.hsOutData[key] as Neusoft.HISFC.Models.Pharmacy.Output; output.Operation.ExamOper.ID = this.phaOutManager.OperInfo.ID; //审核人 output.Operation.ExamOper.OperTime = sysTime; //审核日期 output.Operation.Oper = output.Operation.ExamOper; //操作信息 #region 对数据来源为申请的数据进行处理 if (dr["数据来源"].ToString() == "1") { Neusoft.HISFC.Models.Pharmacy.ApplyOut applyOut = this.hsApplyData[output.User02] as Neusoft.HISFC.Models.Pharmacy.ApplyOut; applyOut.State = "1"; //状态 审批 applyOut.Operation = output.Operation; //操作信息 if (this.itemManager.UpdateApplyOut(applyOut) == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); Function.ShowMsg("更新" + output.Item.Name + "出库申请信息时出错"); return; } if (outListNO == "") { outListNO = applyOut.BillNO; } } #endregion #region 获取单据号 if (outListNO == "") { // //{59C9BD46-05E6-43f6-82F3-C0E3B53155CB} 更改入库单号获取方式 outListNO = phaIntegrate.GetInOutListNO(this.phaOutManager.DeptInfo.ID, false); if (outListNO == null) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); Function.ShowMsg("获取新出库单号出错" + phaIntegrate.Err); return; } } output.OutListNO = outListNO; #endregion #region Output实体必要信息赋值 if (this.isUseMinUnit) //使用最小单位 { output.Quantity = NConvert.ToDecimal(dr["出库数量"]); //出库数量 } else //使用包装单位 { output.Quantity = NConvert.ToDecimal(dr["出库数量"]) * output.Item.PackQty; //出库数量 } output.StoreQty = output.StoreQty - output.Quantity; output.StoreCost = output.StoreQty * output.Item.PriceCollection.RetailPrice / output.Item.PackQty; output.Operation.ExamQty = output.Quantity; //审核数量 output.Memo = dr["备注"].ToString(); output.DrugedBillNO = "0"; //摆药单号 不能为空 output.GetPerson = this.phaOutManager.TargetPerson.ID; //领药人 //----原数据处理方式 //if (isManagerStore) //目标(领用)科室管理库存 // output.State = "1"; //审核 //else // output.State = "2"; //核准 //----现处理方式 对于一般出库 直接设置出库状态为2 output.State = "2"; if (this.isSpecialOut) //特殊出库 直接更新状态为核准 { output.SpecialFlag = "1"; output.State = "2"; } if (output.State == "2") { output.Operation.ApproveOper = output.Operation.Oper; } #endregion #region 以下信息在每次添加新数据时自动生成 output.PrivType = this.phaOutManager.PrivType.ID; //出库类型 output.SystemType = this.phaOutManager.PrivType.Memo; //系统类型 output.StockDept = this.phaOutManager.DeptInfo; //当前科室 output.TargetDept = this.phaOutManager.TargetDept; //目标科室 #endregion #region 形成目标科室的入库记录 #region 根据领药科室是否管理库存 在不管理库存的情况下才处理入库记录 if (!this.isSpecialOut) { input = new Neusoft.HISFC.Models.Pharmacy.Input(); //设置入库单号 if (inListNO == "") { // //{59C9BD46-05E6-43f6-82F3-C0E3B53155CB} 更改入库单号获取方式 inListNO = phaIntegrate.GetInOutListNO(this.phaOutManager.TargetDept.ID, false); if (inListNO == null) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(Language.Msg("对目标库存科室插入入库记录时获取入库单号出错") + this.itemManager.Err); return; } } //获取关联权限类型 关联权限类型不存在时 设置为默认值 if (this.privJoinClass3 != null) { input.PrivType = this.privJoinClass3.Class3Code; input.SystemType = this.privJoinClass3.Class3MeaningCode; } else { input.PrivType = "01"; //一般入库对应的用户类型 input.SystemType = "11"; //一般入库 } input.State = "2"; //已审批 input.StockDept = this.phaOutManager.TargetDept; //库存部门 input.TargetDept = this.phaOutManager.DeptInfo; //目标科室 供货单位 input.InListNO = inListNO; //入库单据号 input.OutListNO = outListNO; //出库单据号 input.Operation.ExamOper.ID = this.phaOutManager.OperInfo.ID; //审批人 input.Operation.ExamOper.OperTime = sysTime; //审批日期 input.Operation.ApproveOper = input.Operation.ExamOper; input.Operation.ApplyOper = input.Operation.ExamOper; decimal storeQty = 0; if (this.itemManager.GetStorageNum(this.phaOutManager.TargetDept.ID, output.Item.ID, out storeQty) == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); MessageBox.Show(Language.Msg("获取" + output.Item.Name + "库存数量时发生错误" + this.itemManager.Err)); return; } input.StoreQty = storeQty + output.Quantity; //设置出库记录中对应的入库单据号 output.InListNO = inListNO; } else { input = null; } #endregion #endregion //原处理方式 第三个参数始终传入False if (this.itemManager.Output(output, input, isManagerStore) == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); Function.ShowMsg("出库保存发生错误" + this.itemManager.Err); return; } this.alPrintData.Add(output); } Neusoft.FrameWork.Management.PublicTrans.Commit(); //for (int i = 0; i < this.dt.DefaultView.Count; i++) //{ // this.dt.DefaultView[i].BeginEdit(); //} Function.ShowMsg("保存成功"); DialogResult rsPrint = MessageBox.Show(Language.Msg("是否打印出库单?"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rsPrint == DialogResult.Yes) { this.Print(); } this.Clear(); }
public void Save() { if (!this.Valid()) { return; } DialogResult rs = MessageBox.Show(Language.Msg("确认向" + this.phaOutManager.TargetDept.Name + "进行出库操作吗?"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (rs == DialogResult.No) { return; } this.dt.DefaultView.RowFilter = "1=1"; for (int i = 0; i < this.dt.DefaultView.Count; i++) { this.dt.DefaultView[i].EndEdit(); } DataTable dtAddMofity = this.dt.GetChanges(DataRowState.Added | DataRowState.Modified); if (dtAddMofity == null || dtAddMofity.Rows.Count <= 0) { return; } Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在进行保存操作..请稍候"); System.Windows.Forms.Application.DoEvents(); #region 事务定义 Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); Neusoft.HISFC.BizLogic.Pharmacy.Constant phaCons = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.BizProcess.Integrate.Pharmacy phaIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy(); //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance); //t.BeginTransaction(); this.itemManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); //phaIntegrate.SetTrans(t.Trans); //phaCons.SetTrans(t.Trans); #endregion DateTime sysTime = this.itemManager.GetDateTimeFromSysDateTime(); //判断领用科室是否管理库存 string outListNO = ""; bool isManagerStore = phaCons.IsManageStore(this.phaOutManager.TargetDept.ID); this.alPrintData = new ArrayList(); //均价出库 只扣减本科室库存 以购入价乘以百分比做为均价出库 foreach (DataRow dr in dtAddMofity.Rows) { string key = dr["药品编码"].ToString() + dr["批号"].ToString(); Neusoft.HISFC.Models.Pharmacy.Output output = this.hsOutData[key] as Neusoft.HISFC.Models.Pharmacy.Output; output.Operation.ExamOper.ID = this.phaOutManager.OperInfo.ID; //审核人 output.Operation.ExamOper.OperTime = sysTime; //审核日期 output.Operation.Oper = output.Operation.ExamOper; //操作信息 #region 获取单据号 if (outListNO == "") { // //{59C9BD46-05E6-43f6-82F3-C0E3B53155CB} 更改入库单号获取方式 outListNO = phaIntegrate.GetInOutListNO(this.phaOutManager.DeptInfo.ID, false); if (outListNO == null) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); Function.ShowMsg("获取新出库单号出错" + phaIntegrate.Err); return; } } output.OutListNO = outListNO; #endregion #region Output实体必要信息赋值 if (this.isUseMinUnit) //使用最小单位 { output.Quantity = NConvert.ToDecimal(dr["出库数量"]); //出库数量 } else //使用包装单位 { output.Quantity = NConvert.ToDecimal(dr["出库数量"]) * output.Item.PackQty; //出库数量 } output.StoreQty = output.StoreQty - output.Quantity; output.StoreCost = output.StoreQty * output.Item.PriceCollection.RetailPrice / output.Item.PackQty; output.Operation.ExamQty = output.Quantity; //审核数量 output.Memo = dr["备注"].ToString(); output.DrugedBillNO = "0"; //摆药单号 不能为空 output.GetPerson = this.phaOutManager.TargetPerson.ID; //领药人 //状态固定赋值为2 output.State = "2"; //核准 output.Operation.ApproveOper = output.Operation.Oper; #endregion #region 以下信息在每次添加新数据时自动生成 output.PrivType = this.phaOutManager.PrivType.ID; //出库类型 output.SystemType = this.phaOutManager.PrivType.Memo; //系统类型 output.StockDept = this.phaOutManager.DeptInfo; //当前科室 output.TargetDept = this.phaOutManager.TargetDept; //目标科室 #endregion if (this.itemManager.Output(output, null, false) == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); Function.ShowMsg("出库保存发生错误" + this.itemManager.Err); return; } this.alPrintData.Add(output); } Neusoft.FrameWork.Management.PublicTrans.Commit(); Function.ShowMsg("保存成功"); DialogResult rsPrint = MessageBox.Show(Language.Msg("是否打印出库单?"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rsPrint == DialogResult.Yes) { this.Print(); } this.Clear(); }
/// <summary> /// 打印函数 /// </summary> /// <param name="al">打印数组</param> /// <param name="i">第几页</param> /// <param name="count">总页数</param> /// <param name="operCode">制单人</param> private void PrintInPlan(ArrayList al, int inow, int icount, string operCode) { if (al.Count <= 0) { MessageBox.Show("没有打印的数据!"); return; } Neusoft.HISFC.BizLogic.Pharmacy.Constant constant = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.Models.Pharmacy.InPlan inPlan = (Neusoft.HISFC.Models.Pharmacy.InPlan)al[0]; #region label赋值 if (this.IsReprint) { this.lbl0.Text = this.lbl0.Text + "(补打)"; } //DateTime sysTime = this.itemMgr.GetDateTimeFromSysDateTime(); //this.lb11.Text = "计划科室 " + inPlan.Dept+this.deptMgr.get + " 计划人 " + inPlan.PlanOper.ID; this.lb11.Text = " 计划人: " + inPlan.PlanOper.Name; this.lb12.Text = "计划日期:" + this.itemMgr.GetDateTimeFromSysDateTime().ToString("yyyy-MM-dd"); this.lb36.Text = "第" + inow.ToString() + "页/共" + icount.ToString() + "页"; this.label1.Text = "单据号:" + inPlan.BillNO; #endregion #region farpoint赋值 decimal sumNum4 = 0; decimal sumNum6 = 0; this.sheetView1.RowCount = 0; for (int i = 0; i < al.Count; i++) { this.sheetView1.AddRows(i, 1); Neusoft.HISFC.Models.Pharmacy.InPlan info = al[i] as Neusoft.HISFC.Models.Pharmacy.InPlan; //this.sheetView1.Cells[i, 0].Text = this.itemMgr.GetItem(output.Item.ID).NameCollection.UserCode;//药品自定义码 this.sheetView1.Cells[i, 0].Text = info.Item.NameCollection.UserCode; //药品自定义码 this.sheetView1.Cells[i, 1].Text = info.Item.Name; //药品名称 this.sheetView1.Cells[i, 2].Text = info.Item.Specs; //规格 if (info.Item.PackQty == 0) { info.Item.PackQty = 1; } decimal count = 0, count2 = 0; count = info.PlanQty / info.Item.PackQty; count2 = (info.PlanQty / info.Item.PackQty) * (info.Item.PriceCollection.PurchasePrice); this.sheetView1.Cells[i, 3].Text = info.Item.PriceCollection.PurchasePrice.ToString(); //计划购入价 this.sheetView1.Cells[i, 4].Text = (info.PlanQty / info.Item.PackQty).ToString(); //计划数量 this.sheetView1.Cells[i, 5].Text = info.Item.PackUnit; //单位 this.sheetView1.Cells[i, 6].Text = ((info.PlanQty / info.Item.PackQty) * (info.Item.PriceCollection.PurchasePrice)).ToString(); //计划金额 if (info.Item.Product.Company.Name != "") { this.sheetView1.Cells[i, 7].Text = info.Item.Product.Company.Name; //供货公司; } else { this.sheetView1.Cells[i, 7].Text = "未选择"; } if (info.Item.Product.Producer.Name != "") { this.sheetView1.Cells[i, 8].Text = info.Item.Product.Producer.Name; //生产厂家 } else { this.sheetView1.Cells[i, 8].Text = "未选择"; } sumNum4 = sumNum4 + count; sumNum6 = sumNum6 + count2; } this.sheetView1.RowCount = al.Count + 1; this.sheetView1.Cells[al.Count, 0].Text = "合计"; this.sheetView1.Cells[al.Count, 1].Text = "共" + al.Count + "行";//行数; this.sheetView1.Cells[al.Count, 4].Text = sumNum4.ToString(); this.sheetView1.Cells[al.Count, 6].Text = sumNum6.ToString(); //宽度 //this.panel4.Width = this.Width - 3; this.fpSpread1.Width = this.panel1.Width - 10; this.fpSpread1.Height = (int)this.sheetView1.RowHeader.Rows[0].Height + (int)(this.sheetView1.Rows[0].Height * (al.Count + 1)) + 10; #endregion #region 打印函数 Neusoft.FrameWork.WinForms.Classes.Print p = new Neusoft.FrameWork.WinForms.Classes.Print(); Neusoft.HISFC.Components.Common.Classes.Function.GetPageSize("PhaInplan", ref p); p.PrintPage(5, 0, this.panel1); #endregion }
public void Save() { if (!this.Valid()) { return; } Neusoft.HISFC.BizLogic.Pharmacy.Constant phaConsManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); bool isManagerStore = phaConsManager.IsManageStore(this.phaOutManager.TargetDept.ID); if (!isManagerStore) { MessageBox.Show(Language.Msg(this.phaOutManager.TargetDept.Name + " 不管理库存,不能通过出库审批进行出库"), "", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DialogResult rs = MessageBox.Show(Language.Msg("确认向" + this.phaOutManager.TargetDept.Name + "进行出库操作吗?"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (rs == DialogResult.No) { return; } this.dt.DefaultView.RowFilter = "1=1"; for (int i = 0; i < this.dt.DefaultView.Count; i++) { this.dt.DefaultView[i].EndEdit(); } DataTable dtAddMofity = this.dt.GetChanges(DataRowState.Added | DataRowState.Modified); if (dtAddMofity == null || dtAddMofity.Rows.Count <= 0) { return; } Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在进行保存操作..请稍候"); System.Windows.Forms.Application.DoEvents(); #region 事务定义 Neusoft.FrameWork.Management.PublicTrans.BeginTransaction(); Neusoft.HISFC.BizLogic.Pharmacy.Constant phaCons = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.BizProcess.Integrate.Pharmacy phaIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy(); this.itemManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans); #endregion DateTime sysTime = this.itemManager.GetDateTimeFromSysDateTime(); string outListNO = ""; this.alPrintData = new ArrayList(); foreach (DataRow dr in dtAddMofity.Rows) { string key = dr["药品编码"].ToString() + dr["批号"].ToString(); Neusoft.HISFC.Models.Pharmacy.Output output = this.hsOutData[key] as Neusoft.HISFC.Models.Pharmacy.Output; if (this.isUseMinUnit) //使用最小单位 { output.Quantity = NConvert.ToDecimal(dr["实发数量"]); //实发数量 } else //使用包装单位 { output.Quantity = NConvert.ToDecimal(dr["实发数量"]) * output.Item.PackQty; //实发数量 } output.StoreQty = output.StoreQty - output.Quantity; output.StoreCost = output.StoreQty * output.Item.PriceCollection.RetailPrice / output.Item.PackQty; output.Memo = dr["备注"].ToString(); output.DrugedBillNO = "0"; //摆药单号 不能为空 output.Operation.ExamOper.ID = this.phaOutManager.OperInfo.ID; //审核人 output.Operation.ExamOper.OperTime = sysTime; //审核日期 output.Operation.ExamQty = output.Quantity; //审核数量 output.Operation.Oper = output.Operation.ExamOper; //操作信息 output.GetPerson = this.phaOutManager.TargetPerson.ID; //领药人 output.State = "1"; //状态 审批 #region 对数据来源为申请的数据进行更新 对本次新添加的数据生成申请信息记录 if (dr["数据来源"].ToString() == "1") { Neusoft.HISFC.Models.Pharmacy.ApplyOut applyOut = this.hsApplyData[output.User02] as Neusoft.HISFC.Models.Pharmacy.ApplyOut; if (outListNO == "") { outListNO = applyOut.BillNO; } decimal tempApproveQty = applyOut.Operation.ApproveQty; applyOut.Operation = output.Operation; //操作信息 //未选择审批标记 只记录本次待发送的数量 不扣库存处理 if (!NConvert.ToBoolean(dr["审批"])) { //数量累计 applyOut.Operation.ApproveQty = tempApproveQty + output.Quantity; applyOut.State = "0"; } else { applyOut.Operation.ApproveOper = output.Operation.Oper; applyOut.State = "2"; } // {EE05DA01-8969-404d-9A6B-EE8AD0BC1CD0}处理出库审批并发的问题 int resultApplyOut = this.itemManager.UpdateApplyOut(applyOut, true); if (resultApplyOut == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); Function.ShowMsg("更新" + output.Item.Name + "出库申请信息时出错"); return; } if (resultApplyOut == 0) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); Function.ShowMsg("该" + output.Item.Name + "申请信息已改变,请重新获取申请信息"); return; } } else { #region 无申请记录 此时只需更改申请人 到底需不需要添加申请信息呢? 不需要 output.Operation.ApplyOper = output.Operation.Oper; //申请人 output.Operation.ApplyQty = output.Quantity; //申请数量 #endregion } #endregion #region 获取单据号 if (outListNO == "") { // //{59C9BD46-05E6-43f6-82F3-C0E3B53155CB} 更改入库单号获取方式 outListNO = phaIntegrate.GetInOutListNO(this.phaOutManager.DeptInfo.ID, false); if (outListNO == null) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); Function.ShowMsg("获取新出库单号出错" + phaIntegrate.Err); return; } } output.OutListNO = outListNO; #endregion #region 以下信息在每次添加新数据时自动生成 output.PrivType = this.phaOutManager.PrivType.ID; //出库类型 output.SystemType = this.phaOutManager.PrivType.Memo; //系统类型 output.StockDept = this.phaOutManager.DeptInfo; //当前科室 output.TargetDept = this.phaOutManager.TargetDept; //目标科室 #endregion //非药柜科室向药柜出库 进行特殊处理 if (!this.phaOutManager.IsStockArk && this.phaOutManager.IsTargetArk) { if (this.itemManager.ArkOutput(output, this.phaOutManager.IsStockArk, this.phaOutManager.IsTargetArk, false, true) == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); Function.ShowMsg("出库保存发生错误" + this.itemManager.Err); return; } } else { if (this.itemManager.Output(output, null, false) == -1) { Neusoft.FrameWork.Management.PublicTrans.RollBack(); Function.ShowMsg("出库保存发生错误" + this.itemManager.Err); return; } } this.alPrintData.Add(output); } Neusoft.FrameWork.Management.PublicTrans.Commit(); Function.ShowMsg("保存成功"); DialogResult rsPrint = MessageBox.Show(Language.Msg("是否打印出库单?"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rsPrint == DialogResult.Yes) { this.Print(); } this.Clear(); }
/// <summary> /// 打印函数 /// </summary> /// <param name="al">打印数组</param> /// <param name="i">第几页</param> /// <param name="count">总页数</param> /// <param name="operCode">制单人</param> private void PrintOutput(ArrayList al, int inow, int icount, string operCode) { if (al.Count <= 0) { MessageBox.Show("没有打印的数据!"); return; } Neusoft.HISFC.BizLogic.Pharmacy.Constant constant = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.Models.Pharmacy.Output info = (Neusoft.HISFC.Models.Pharmacy.Output)al[0]; #region label赋值 //this.lbTitle.Text = this.deptMgr.GetDeptmentById(info.Dept.ID) + "药品出库单" ; if (this.IsReprint) { this.lbl0.Text = this.lbl0.Text + "(补打)"; } string strCompany = ""; try { strCompany = this.deptMgr.GetDeptmentById(info.TargetDept.ID).Name; } catch {} this.lb11.Text = "领用部门:" + "(" + info.TargetDept.ID + ")" + strCompany; this.lb12.Text = "领用日期:" + info.Operation.ExamOper.OperTime.ToString("yyyy-MM-dd"); //this.lb21.Text = "发出仓库:" + this.deptMgr.GetDeptmentById(info.Dept.ID); this.lb36.Text = "第" + inow.ToString() + "页/共" + icount.ToString() + "页"; #endregion #region farpoint赋值 decimal sumNum6 = 0; decimal sumNum8 = 0; this.sheetView1.RowCount = 0; for (int i = 0; i < al.Count; i++) { this.sheetView1.AddRows(i, 1); Neusoft.HISFC.Models.Pharmacy.Output output = al[i] as Neusoft.HISFC.Models.Pharmacy.Output; this.sheetView1.Cells[i, 0].Text = this.itemMgr.GetItem(output.Item.ID).NameCollection.UserCode; //药品自定义码 this.sheetView1.Cells[i, 1].Text = output.Item.Name; //药品名称 this.sheetView1.Cells[i, 2].Text = output.Item.Specs; //规格 if (output.Item.PackQty == 0) { output.Item.PackQty = 1; } decimal count = 0, count2 = 0; //count = Math.Round(output.Operation.ExamQty / output.Item.PackQty, 4); count = output.Operation.ExamQty / output.Item.PackQty; //count2 = System.Math.Round((output.Item.PriceCollection.RetailPrice) * count, decimals); count2 = (output.Item.PriceCollection.RetailPrice) * count; this.sheetView1.Cells[i, 3].Text = output.Item.PackQty.ToString(); //包装数量 this.sheetView1.Cells[i, 4].Text = output.Item.MinUnit; //最小单位 this.sheetView1.Cells[i, 5].Text = (output.Item.PriceCollection.RetailPrice / output.Item.PackQty).ToString(); //药房价 this.sheetView1.Cells[i, 6].Text = count.ToString(); //实发数量 this.sheetView1.Cells[i, 7].Text = output.Item.PackUnit; //单位 this.sheetView1.Cells[i, 8].Text = (output.Item.PriceCollection.RetailPrice).ToString(); //零售价 //this.sheetView1.Cells[i, 7].Text = System.Math.Round(output.Item.PriceCollection.RetailPrice, decimals).ToString();//零售价 this.sheetView1.Cells[i, 9].Text = ((output.Item.PriceCollection.RetailPrice) * count).ToString(); //零售总金额 //this.sheetView1.Cells[i, 8].Text = (System.Math.Round(output.Item.PriceCollection.RetailPrice, decimals) * count2).ToString();//零售总金额 this.sheetView1.Cells[i, 11].Text = output.ValidTime.ToString("yyyy-MM-dd") + " "; this.sheetView1.Cells[i, 10].Text = output.BatchNO + " "; sumNum6 = sumNum6 + count; sumNum8 = sumNum8 + count2; } this.sheetView1.RowCount = al.Count + 1; this.sheetView1.Cells[al.Count, 0].Text = "合计"; this.sheetView1.Cells[al.Count, 1].Text = "共" + al.Count + "行";//行数; this.sheetView1.Cells[al.Count, 6].Text = sumNum6.ToString(); this.sheetView1.Cells[al.Count, 9].Text = sumNum8.ToString(); //宽度 //this.panel4.Width = this.Width - 3; this.fpSpread1.Width = this.panel1.Width - 10; this.fpSpread1.Height = (int)this.sheetView1.RowHeader.Rows[0].Height + (int)(this.sheetView1.Rows[0].Height * (al.Count + 1)) + 10; #endregion #endregion #region 打印函数 //Neusoft.FrameWork.WinForms.Classes.Print p = new Neusoft.FrameWork.WinForms.Classes.Print(); ////p.IsDataAutoExtend = false;//p.ShowPageSetup(); //Neusoft.HISFC.Models.Base.PageSize page = new Neusoft.HISFC.Models.Base.PageSize(); ////page.Height = 532; ////page.Width = 798; //page.Name = "PhaOutput"; //p.SetPageSize(page); ////p.PrintPage(5,1,this); //p.PrintPreview(5, 1, this); Neusoft.FrameWork.WinForms.Classes.Print p = new Neusoft.FrameWork.WinForms.Classes.Print(); Neusoft.HISFC.Components.Common.Classes.Function.GetPageSize("PhaOutput", ref p); p.PrintPage(5, 0, this.panel1); #endregion }
/// <summary> /// 出库单据查询 /// </summary> protected override void QueryOut() { Neusoft.HISFC.BizLogic.Pharmacy.Item itemManager = new Neusoft.HISFC.BizLogic.Pharmacy.Item(); ArrayList alList = new ArrayList(); if (this.PrivType != null && this.PrivType.ID != "") { #region 根据不同权限进行不同处理 switch (this.PrivType.Memo) { case "16": //核准入库 alList = itemManager.QueryOutputListForApproveInput(this.DeptInfo.ID, this.BeginDate, this.EndDate); break; } #endregion } else { alList = itemManager.QueryOutputList(this.DeptInfo.ID, "A", this.State, this.BeginDate, this.EndDate); } if (alList == null) { MessageBox.Show(Language.Msg("查询单据列表发生错误" + itemManager.Err)); } this.neuSpread1_Sheet1.Rows.Count = 0; foreach (Neusoft.FrameWork.Models.NeuObject info in alList) { if (this.MarkPrivType != null) { if (this.MarkPrivType.ContainsKey(info.User01)) //对于过滤的权限不显示 { continue; } } this.neuSpread1_Sheet1.Rows.Add(0, 1); this.neuSpread1_Sheet1.Cells[0, 0].Text = info.ID; this.neuSpread1_Sheet1.Cells[0, 2].Text = this.outTypeHelper.GetName(info.User01); Neusoft.HISFC.Models.Pharmacy.Company company = new Neusoft.HISFC.Models.Pharmacy.Company(); if (this.deptHelper.GetObjectFromID(info.Memo) == null) { Neusoft.HISFC.BizLogic.Pharmacy.Constant constant = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); company = constant.QueryCompanyByCompanyID(info.Memo); if (company == null) { MessageBox.Show(constant.Err); return; } } else { company.ID = info.Memo; company.Name = this.deptHelper.GetName(info.Memo); } this.neuSpread1_Sheet1.Cells[0, 3].Text = company.Name; this.neuSpread1_Sheet1.Cells[0, (int)ColumnSet.ColTargetID].Text = company.ID; } }
/// <summary> /// 打印函数 /// </summary> /// <param name="al">打印数组</param> /// <param name="i">第几页</param> /// <param name="count">总页数</param> /// <param name="operCode">制单人</param> private void PrintStockplan(ArrayList al, int inow, int icount, string operCode) { if (al.Count <= 0) { MessageBox.Show("没有打印的数据!"); return; } Neusoft.HISFC.BizLogic.Pharmacy.Constant constant = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.Models.Pharmacy.StockPlan stockPlan = (Neusoft.HISFC.Models.Pharmacy.StockPlan)al[0]; Neusoft.HISFC.BizLogic.Manager.Constant constantMgr = new Neusoft.HISFC.BizLogic.Manager.Constant(); Neusoft.HISFC.BizLogic.Manager.Department deptMgr = new Neusoft.HISFC.BizLogic.Manager.Department(); Neusoft.HISFC.BizProcess.Integrate.Pharmacy itemMgr = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy(); string strHos = constantMgr.GetHospitalName(); string dosageID = string.Empty; //剂型 if (stockPlan.State == "2") { this.lbl0.Text = strHos + "药品采购审批单"; } else { this.lbl0.Text = strHos + "药品采购计划单"; //label2.Visible = false; } #region label赋值 if (this.IsReprint) { this.lbl0.Text = this.lbl0.Text + "(补打)"; } //DateTime sysTime = this.itemMgr.GetDateTimeFromSysDateTime(); //this.lb11.Text = "计划科室 " + inPlan.Dept+this.deptMgr.get + " 计划人 " + inPlan.PlanOper.ID; this.lb11.Text = " 计划人: " + stockPlan.Oper.Name; this.lb12.Text = "计划日期:" + this.itemMgr.GetDateTimeFromSysDateTime().ToString("yyyy-MM-dd"); this.label2.Text = "采购日期:" + stockPlan.StockOper.OperTime.ToString("yyyy-MM-dd"); this.lb36.Text = "第" + inow.ToString() + "页/共" + icount.ToString() + "页"; this.label1.Text = "单据号:" + stockPlan.BillNO; this.label3.Text = "科室:" + deptMgr.GetDeptmentById(stockPlan.Dept.ID); #endregion #region farpoint赋值 decimal sumNum5 = 0; decimal sumNum8 = 0; decimal sumNum9 = 0; this.sheetView1.RowCount = 0; #region {1EC17564-2FAD-4a77-97AC-4C57076888B2} FarPoint.Win.Spread.CellType.NumberCellType numberCellType1 = new FarPoint.Win.Spread.CellType.NumberCellType(); numberCellType1.DecimalPlaces = 4; this.sheetView1.Columns[6].CellType = numberCellType1; this.sheetView1.Columns[7].CellType = numberCellType1; this.sheetView1.Columns[8].CellType = numberCellType1; #endregion for (int i = 0; i < al.Count; i++) { this.sheetView1.AddRows(i, 1); Neusoft.HISFC.Models.Pharmacy.StockPlan info = al[i] as Neusoft.HISFC.Models.Pharmacy.StockPlan; this.sheetView1.Cells[i, 0].Text = info.Item.ID; // info.Item.NameCollection.UserCode;//药品自定义码 this.sheetView1.Cells[i, 1].Text = info.Item.Name; //药品名称 this.sheetView1.Cells[i, 2].Text = info.Item.Specs; //规格 if (info.Item.PackQty == 0) { info.Item.PackQty = 1; } decimal count = 0, count2 = 0, count3 = 0; count = info.StockApproveQty / info.Item.PackQty; count2 = (info.StockApproveQty / info.Item.PackQty) * (info.Item.PriceCollection.PurchasePrice); count3 = (info.StockApproveQty / info.Item.PackQty) * (info.Item.PriceCollection.RetailPrice); this.sheetView1.Cells[i, 3].Text = info.Item.PackUnit;//单位 // Neusoft.HISFC.BizProcess.Integrate.Pharmacy itemMgr = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy(); dosageID = ((Neusoft.HISFC.Models.Pharmacy.Item)itemMgr.GetItem(info.Item.ID)).DosageForm.ID; this.sheetView1.Cells[i, 4].Text = ((Neusoft.FrameWork.Models.NeuObject)constantMgr.GetConstant("DOSAGEFORM", dosageID)).Name; //info.Item.DosageForm.Name; //剂型 this.sheetView1.Cells[i, 5].Text = (info.StockApproveQty / info.Item.PackQty).ToString(); //计划数量 this.sheetView1.Cells[i, 6].Text = info.StockPrice.ToString(); //计划购入价 // info.Item.PackUnit;// this.sheetView1.Cells[i, 7].Text = info.Item.Price.ToString(); //参考零售价 this.sheetView1.Cells[i, 8].Text = ((info.StockApproveQty / info.Item.PackQty) * (info.StockPrice)).ToString(); //计划金额 this.sheetView1.Cells[i, 9].Text = ((info.StockApproveQty / info.Item.PackQty) * (info.Item.PriceCollection.RetailPrice)).ToString(); //零售金额 //if (info.Item.Product.Company.Name != "") // this.sheetView1.Cells[i, 7].Text = info.Item.Product.Company.Name; //供货公司; //else // this.sheetView1.Cells[i, 7].Text = "未选择"; if (info.Company.Name != "") { this.sheetView1.Cells[i, 10].Text = info.Company.Name; //供货公司; } else { this.sheetView1.Cells[i, 10].Text = "未选择"; } //if (info.Item.Product.Producer.Name != "") // this.sheetView1.Cells[i, 8].Text = info.Item.Product.Producer.Name; //生产厂家 //else // this.sheetView1.Cells[i, 8].Text = "未选择"; sumNum5 = sumNum5 + count; sumNum8 = sumNum8 + count2; sumNum9 = sumNum9 + count3; } this.sheetView1.RowCount = al.Count + 1; this.sheetView1.Cells[al.Count, 0].Text = "合计"; this.sheetView1.Cells[al.Count, 1].Text = "共" + al.Count + "行"; //行数; this.sheetView1.Cells[al.Count, 5].Text = sumNum5.ToString(); //购入数量合计 this.sheetView1.Cells[al.Count, 8].Text = sumNum8.ToString(); //购入金额合计 this.sheetView1.Cells[al.Count, 9].Text = sumNum9.ToString(); //零售金额合计 //宽度 //this.panel4.Width = this.Width - 3; this.fpSpread1.Width = this.panel1.Width - 10; this.fpSpread1.Height = (int)this.sheetView1.RowHeader.Rows[0].Height + (int)(this.sheetView1.Rows[0].Height * (al.Count + 1)) + 10; #endregion #region 打印函数 Neusoft.FrameWork.WinForms.Classes.Print p = new Neusoft.FrameWork.WinForms.Classes.Print(); Neusoft.HISFC.Components.Common.Classes.Function.GetPageSize("PhaInplan", ref p); p.PrintPage(5, 0, this.panel1); #endregion }
protected override void OnLoad(EventArgs e) { Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在加载数据 请稍候..."); Application.DoEvents(); Neusoft.HISFC.BizLogic.Pharmacy.Item itemManagment = new Neusoft.HISFC.BizLogic.Pharmacy.Item(); List <Neusoft.HISFC.Models.Pharmacy.Item> itemDictionary = itemManagment.QueryItemAvailableList(); //sdh 20190107 显示通用名 foreach (Neusoft.HISFC.Models.Pharmacy.Item it1 in itemDictionary) { it1.Name = it1.NameCollection.RegularName; it1.Memo = it1.Specs; it1.SpellCode = it1.NameCollection.RegularSpell.SpellCode; it1.WBCode = it1.NameCollection.RegularSpell.WBCode; it1.UserCode = it1.NameCollection.RegularSpell.UserCode; } if (itemDictionary == null) { MessageBox.Show("加载药品列表发生错误" + itemManagment.Err); return; } //this.cmbDrug.AddItems(new System.Collections.ArrayList(itemDictionary.ToArray())); foreach (Neusoft.HISFC.Models.Pharmacy.Item info in itemDictionary) { this.hsDrug.Add(info.ID, info); } this.ucDrugList1.ShowPharmacyList(); //this.ucDrugList1.ShowPharmacyList(false); 是否显示协定处方 this.ucDrugList1.SetFormat(null, new int[] { 10, 170, 90, 20, 60, 170, 90, 20, 20, 20, 20, 170 }, null); this.ucDrugList1.ChooseDataEvent += new Neusoft.HISFC.Components.Common.Controls.ucDrugList.ChooseDataHandler(ucDrugList1_ChooseDataEvent); Neusoft.HISFC.BizLogic.Pharmacy.Constant phaCons = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); ArrayList alProduce = phaCons.QueryCompany("0"); if (alProduce == null) { MessageBox.Show("加载生产厂家列表发生错误" + phaCons.Err); return; } foreach (Neusoft.HISFC.Models.Pharmacy.Company compyInfo in alProduce) { this.hsProduce.Add(compyInfo.ID, compyInfo.Name); } Neusoft.HISFC.BizLogic.Manager.Department deptManagment = new Neusoft.HISFC.BizLogic.Manager.Department(); ArrayList alDept = deptManagment.GetDeptmentAll(); if (alDept == null) { MessageBox.Show("加载科室列表发生错误" + phaCons.Err); return; } foreach (Neusoft.HISFC.Models.Base.Department deptInfo in alDept) { this.hsDept.Add(deptInfo.ID, deptInfo.Name); } Neusoft.HISFC.BizLogic.Manager.Constant consManagment = new Neusoft.HISFC.BizLogic.Manager.Constant(); ArrayList alDosage = consManagment.GetList("DOSAGEFORM"); if (alDosage == null) { MessageBox.Show("加载剂型列表发生错误" + consManagment.Err); return; } this.dosageHelper = new Neusoft.FrameWork.Public.ObjectHelper(alDosage); Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm(); base.OnLoad(e); }
/// <summary> /// 打印函数 /// </summary> /// <param name="al">打印数组</param> /// <param name="i">第几页</param> /// <param name="count">总页数</param> private void Print(ArrayList al, int inow, int icount, bool isLastPage) { if (al.Count <= 0) { MessageBox.Show("没有打印的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Neusoft.HISFC.BizLogic.Pharmacy.Constant constant = new Neusoft.HISFC.BizLogic.Pharmacy.Constant(); Neusoft.HISFC.Models.Pharmacy.Output info = (Neusoft.HISFC.Models.Pharmacy.Output)al[0]; #region Label赋值 this.SetTitle(info); if (this.IsReprint) { this.lbTitle.Text = this.lbTitle.Text + " (补打)"; } string strCompany = ""; try { strCompany = this.managerIntegrate.GetDepartment(info.TargetDept.ID).Name; } catch { } this.lbTargetDept.Text = strCompany; Neusoft.HISFC.Models.Base.Department stockDept = this.managerIntegrate.GetDepartment(info.StockDept.ID); if (stockDept != null) { this.lbSourceDept.Text = stockDept.Name; } this.lbBillNO.Text = info.OutListNO; this.lbOper.Text = this.itemManager.Operator.Name; this.lbDate.Text = info.Operation.ExamOper.OperTime.ToString("yyyy年MM月dd日"); this.lbPageNO.Text = "第" + inow.ToString() + "页/共" + icount.ToString() + "页"; #endregion #region Farpoint赋值 decimal totWholeCost = 0; decimal totRetailCost = 0; this.fpSpread1_Sheet1.RowCount = 0; for (int i = 0; i < al.Count; i++) { this.fpSpread1_Sheet1.AddRows(i, 1); Neusoft.HISFC.Models.Pharmacy.Output output = al[i] as Neusoft.HISFC.Models.Pharmacy.Output; Neusoft.HISFC.Models.Pharmacy.Item tempItem = this.itemManager.GetItem(output.Item.ID); if (tempItem != null) { this.fpSpread1_Sheet1.Cells[i, 0].Text = tempItem.NameCollection.UserCode; //药品自定义码 } this.fpSpread1_Sheet1.Cells[i, 1].Text = output.Item.Name; //药品名称 this.fpSpread1_Sheet1.Cells[i, 2].Text = output.Item.Specs; //规格 this.fpSpread1_Sheet1.Cells[i, 3].Text = output.Item.PackUnit; //单位 if (output.Item.PackQty == 0) { output.Item.PackQty = 1; } decimal count = 0; count = Math.Round(output.Operation.ExamQty / output.Item.PackQty, 2); this.fpSpread1_Sheet1.Cells[i, 4].Text = count.ToString(); //实发数量 this.fpSpread1_Sheet1.Cells[i, 5].Text = output.Item.PriceCollection.WholeSalePrice.ToString(); //批发价 this.fpSpread1_Sheet1.Cells[i, 6].Text = output.Item.PriceCollection.RetailPrice.ToString(); //零售价 decimal wholeCost = Math.Round(output.Operation.ExamQty / output.Item.PackQty * output.Item.PriceCollection.WholeSalePrice, 2); decimal retailCost = Math.Round(output.Operation.ExamQty / output.Item.PackQty * output.Item.PriceCollection.RetailPrice, 2); this.fpSpread1_Sheet1.Cells[i, 7].Text = wholeCost.ToString(); this.fpSpread1_Sheet1.Cells[i, 8].Text = retailCost.ToString(); this.fpSpread1_Sheet1.Cells[i, 9].Text = (retailCost - wholeCost).ToString(); //有效期暂时不显示 但应该要 //this.fpSpread1_Sheet1.Cells[i, 11].Text = output.ValidTime.ToString( "yyyy-MM-dd" ) + " "; if (this.fpSpread1_Sheet1.Columns[10].Label == "生产批号") { this.fpSpread1_Sheet1.Cells[i, 10].Text = output.BatchNO; } else { this.fpSpread1_Sheet1.Cells[i, 10].Text = output.Memo; } totWholeCost = totWholeCost + wholeCost; totRetailCost = totRetailCost + retailCost; } this.fpSpread1_Sheet1.RowCount = al.Count + 1; this.fpSpread1_Sheet1.Cells[al.Count, 1].Text = "合计"; this.fpSpread1_Sheet1.Cells[al.Count, 7].Text = totWholeCost.ToString(); this.fpSpread1_Sheet1.Cells[al.Count, 8].Text = totRetailCost.ToString(); this.fpSpread1_Sheet1.Cells[al.Count, 9].Text = (totRetailCost - totWholeCost).ToString(); billWholeCost = billWholeCost + totWholeCost; billRetailCost = billRetailCost + totRetailCost; if (isLastPage == true) //最后一张单 { int index = this.fpSpread1_Sheet1.Rows.Count; this.fpSpread1_Sheet1.Rows.Add(index, 1); this.fpSpread1_Sheet1.Cells[index, 1].Text = "总计"; this.fpSpread1_Sheet1.Cells[index, 7].Text = billWholeCost.ToString(); this.fpSpread1_Sheet1.Cells[index, 8].Text = billRetailCost.ToString(); this.fpSpread1_Sheet1.Cells[index, 9].Text = (billRetailCost - billWholeCost).ToString(); } //宽度 this.fpSpread1.Width = this.Width - 10; this.fpSpread1.Height = (int)this.fpSpread1_Sheet1.RowHeader.Rows[0].Height + (int)(this.fpSpread1_Sheet1.Rows[0].Height * (al.Count + 1)) + 10; #endregion Neusoft.FrameWork.WinForms.Classes.Print p = new Neusoft.FrameWork.WinForms.Classes.Print(); //Neusoft.HISFC.Components.Common.Classes.Function.GetPageSize( "PhaOutput", ref p ); p.PrintPage(5, 10, this); }