Exemplo n.º 1
0
        /// <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];
            Neusoft.HISFC.BizProcess.Integrate.Pharmacy itemMgr     = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy();
            Neusoft.HISFC.BizLogic.Manager.Constant     constantMgr = new Neusoft.HISFC.BizLogic.Manager.Constant();

            string dosageID = string.Empty; //剂型

            #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;
            this.lb2.Text    = "科室:" + inPlan.Dept.Name;


            #endregion

            #region farpoint赋值

            decimal sumNum5 = 0;
            decimal sumNum8 = 0;
            decimal sumNum9 = 0;
            this.sheetView1.RowCount = 0;
            FarPoint.Win.Spread.CellType.NumberCellType numberCellType1 = new FarPoint.Win.Spread.CellType.NumberCellType();
            numberCellType1.DecimalPlaces       = 4;
            this.sheetView1.Columns[6].CellType = numberCellType1;//{1EC17564-2FAD-4a77-97AC-4C57076888B2}
            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, 0].Text = info.Item.ID;       //药品编码
                this.sheetView1.Cells[i, 1].Text = info.Item.Name;     //药品名称
                this.sheetView1.Cells[i, 2].Text = info.Item.Specs;    //规格
                this.sheetView1.Cells[i, 3].Text = info.Item.PackUnit; //单位

                dosageID = ((Neusoft.HISFC.Models.Pharmacy.Item) this.itemMgr.GetItem(info.Item.ID)).DosageForm.ID;

                this.sheetView1.Cells[i, 4].Text = ((Neusoft.FrameWork.Models.NeuObject) this.constantMgr.GetConstant("DOSAGEFORM", dosageID)).Name; //剂型

                if (info.Item.PackQty == 0)
                {
                    info.Item.PackQty = 1;
                }


                this.sheetView1.Cells[i, 5].Text = (info.PlanQty / info.Item.PackQty).ToString();                                               //计划数量
                this.sheetView1.Cells[i, 6].Text = info.Item.PriceCollection.PurchasePrice.ToString();                                          //计划购入价
                this.sheetView1.Cells[i, 7].Text = info.Item.PriceCollection.RetailPrice.ToString();                                            //零售价
                this.sheetView1.Cells[i, 8].Text = ((info.PlanQty / info.Item.PackQty) * (info.Item.PriceCollection.PurchasePrice)).ToString(); //计划金额
                this.sheetView1.Cells[i, 9].Text = ((info.PlanQty / info.Item.PackQty) * (info.Item.PriceCollection.RetailPrice)).ToString();   //零售金额



                //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, 10].Text = info.Item.Product.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 = "未选择";

                decimal count = 0, count2 = 0, count3 = 0;
                count  = info.PlanQty / info.Item.PackQty;
                count2 = (info.PlanQty / info.Item.PackQty) * (info.Item.PriceCollection.PurchasePrice);
                count3 = (info.PlanQty / info.Item.PackQty) * (info.Item.PriceCollection.RetailPrice);

                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
        }
Exemplo n.º 2
0
        /// <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
        }