/// <summary> /// 检索药品信息 /// </summary> private void RetrieveData( ) { //显示等待信息 Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm(Language.Msg("正在检索药品信息...")); Application.DoEvents( ); //取药品数据 List <Neusoft.HISFC.Models.Pharmacy.Item> al = item.QueryItemList(true); //对药品进行排序 CompareApplyOut compare = new CompareApplyOut(); al.Sort(compare); if (al == null) { MessageBox.Show(item.Err); Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm( ); return; } //取药品类型数组 Neusoft.HISFC.BizProcess.Integrate.Manager manager = new Neusoft.HISFC.BizProcess.Integrate.Manager( ); this.drugTypeHelper.ArrayObject = manager.GetConstantList(Neusoft.HISFC.Models.Base.EnumConstant.ITEMTYPE); this.qualityHelper.ArrayObject = manager.GetConstantList(Neusoft.HISFC.Models.Base.EnumConstant.DRUGQUALITY); //显示药品数据 Neusoft.HISFC.Models.Pharmacy.Item info; for (int i = 0; i < al.Count; i++) { info = al[i] as Neusoft.HISFC.Models.Pharmacy.Item; //{D3E6C674-8623-42bf-8F60-C92A303E4073} if (info.ValidState != Neusoft.HISFC.Models.Base.EnumValidState.Valid) { continue; } this.dsDrug.Tables[0].Rows.Add(new object[] { false, //是否添加 info.Name, //药品名称 info.Specs, //药品规格 info.PriceCollection.RetailPrice, //零售价 qualityHelper.GetName(info.Quality.ID), //药品性质 info.PackUnit, //包装单位 info.PackQty, //包装数量 info.MinUnit, //最小单位 info.ID, //药品编码 drugTypeHelper.GetName(info.Type.ID), //药品类型 info.NameCollection.SpellCode, //拼音码 info.NameCollection.WBCode, //五笔码 info.NameCollection.UserCode, //自定义码 info.NameCollection.RegularName, //通用名 info.NameCollection.SpellCode, //通用名拼音码 info.NameCollection.WBCode, //通用名五笔码 }); //设置格式 this.SetFormat( ); Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm(i, al.Count); Application.DoEvents( ); } Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm( ); }
/// <summary> /// 数据显示 /// </summary> /// <param name="alOriginalData"></param> /// <param name="drugBillClass"></param> public void ShowData(ArrayList alOriginalData, Neusoft.HISFC.Models.Pharmacy.DrugBillClass drugBillClass) { ArrayList alData = new ArrayList(); this.AlterApplyData(alOriginalData, ref alData); CompareApplyOut compare = new CompareApplyOut(); alData.Sort(compare); #region 静态科室帮助信息获取 if (ucDrugTotal.hsDept.Count == 0) { Neusoft.HISFC.BizLogic.Manager.Department deptManager = new Neusoft.HISFC.BizLogic.Manager.Department(); ArrayList alDept = deptManager.GetDeptmentAll(); foreach (Neusoft.HISFC.Models.Base.Department dept in alDept) { ucDrugTotal.hsDept.Add(dept.ID, dept.Name); } } #endregion this.SuspendLayout(); Neusoft.FrameWork.Management.DataBaseManger dataManager = new Neusoft.FrameWork.Management.DataBaseManger(); this.lbPrintTime.Text = "打印时间:" + dataManager.GetDateTimeFromSysDateTime().ToString(); ((System.ComponentModel.ISupportInitialize)(this.neuSpread1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.neuSpread1_Sheet1)).BeginInit(); int iRow = 0; int iCount = 0; decimal totCost = 0;//总金额{65581D3C-D84E-4d4d-AF93-B58077F10DD5} foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alData) { iCount++; if (iCount == 6) { this.neuSpread1_Sheet1.Rows.Add(iRow, 1); iRow++; iCount = 0; } #region 数据赋值 if (ucDrugTotal.hsDept.ContainsKey(info.ApplyDept.ID)) { this.lbTitl.Text = " " + ucDrugTotal.hsDept[info.ApplyDept.ID] + drugBillClass.Name + "(汇总)" + " " + this.ifBPrint; } else { this.lbTitl.Text = " " + info.ApplyDept.Name + drugBillClass.Name + "(汇总)" + " " + this.ifBPrint; } this.neuSpread1_Sheet1.Rows.Add(iRow, 1); info.Item.NameCollection.RegularName = itemManager.GetItem(info.Item.ID).NameCollection.RegularName;//{8CA1AEE7-F038-4c32-BD3E-ECCC8DFE687B} this.neuSpread1_Sheet1.Cells[iRow, 0].Text = info.PlaceNO; //屏蔽剂型的显示 this.neuSpread1_Sheet1.Cells[iRow, 1].Text = info.Item.NameCollection.Name + "(" + info.Item.Name + ")" + "[ " + info.Item.Specs + " ]"; char[] ca = this.neuSpread1_Sheet1.Cells[iRow, 1].Text.ToCharArray(); //{8CA1AEE7-F038-4c32-BD3E-ECCC8DFE687B} int j = System.Text.Encoding.Default.GetByteCount(ca, 0, ca.Length); if (j / 40 >= 1 && j % 40 == 0) //大于一行并且正好等于下一行 { this.neuSpread1_Sheet1.Rows[iRow].Height = (j / 40) * Neusoft.FrameWork.Function.NConvert.ToInt32(this.neuSpread1_Sheet1.Rows.Default.Height); } else if (j / 40 >= 1 && j % 40 > 0)//大于一行,并且延伸到下一行 { this.neuSpread1_Sheet1.Rows[iRow].Height = ((j / 40) + 1) * Neusoft.FrameWork.Function.NConvert.ToInt32(this.neuSpread1_Sheet1.Rows.Default.Height); } this.neuSpread1_Sheet1.Cells[iRow, 2].Text = info.Operation.ApplyQty.ToString(); this.neuSpread1_Sheet1.Cells[iRow, 3].Text = info.Item.MinUnit; this.neuSpread1_Sheet1.Cells[iRow, 4].Text = info.Item.PriceCollection.RetailPrice.ToString(); if (info.Item.User01 == "1") //传入的数量为包装单位 { this.neuSpread1_Sheet1.Cells[iRow, 5].Value = (info.Operation.ApplyQty * info.Item.PriceCollection.RetailPrice); } else { this.neuSpread1_Sheet1.Cells[iRow, 5].Value = (info.Operation.ApplyQty / info.Item.PackQty * info.Item.PriceCollection.RetailPrice); } totCost += Neusoft.FrameWork.Function.NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[iRow, 5].Value); iRow++; #endregion } ((System.ComponentModel.ISupportInitialize)(this.neuSpread1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.neuSpread1_Sheet1)).EndInit(); #region 汇总量计算 try { if (this.neuSpread1_Sheet1.Rows.Count > 0) { this.neuSpread1_Sheet1.Rows.Add(iRow, 1); this.neuSpread1_Sheet1.Cells[iRow, 0].ColumnSpan = 6; this.neuSpread1_Sheet1.Cells[iRow, 0].Text = "领药: 发药: 复准: 制表人:" + (Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee).Name + " 累计:" + totCost.ToString(); //this.neuSpread1_Sheet1.Cells[iRow, 5].Formula = string.Format("SUM(E1:E{0})", iRow.ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); } this.ResumeLayout(true); #endregion }