Example #1
0
        /// <summary>
        /// 生成中草药处方
        /// </summary>
        /// <param name="alTmp"></param>
        private void SetPccRecipe(ArrayList alTmp)
        {
            view.RemoveRows(0, view.RowCount);
            view.AddRows(0, alTmp.Count);

            Neusoft.HISFC.Models.Order.OutPatient.Order orderInfo = null;
            decimal money = 0m;

            for (int row = 0, count = 0; count < alTmp.Count; row++, count += pccPerRowCount)
            {
                for (int perCol = 0; perCol < pccPerRowCount; perCol++)
                {
                    if (row * pccPerRowCount + perCol > alTmp.Count - 1)
                    {
                        break;
                    }
                    orderInfo = new Neusoft.HISFC.Models.Order.OutPatient.Order();
                    orderInfo = alTmp[row * pccPerRowCount + perCol] as Neusoft.HISFC.Models.Order.OutPatient.Order;

                    //不打印NULL和已经退费的
                    if (orderInfo == null || orderInfo.Qty == 0)
                    {
                        continue;
                    }


                    this.view.Cells[row, perCol * 11 + (int)Columns.drugName].Text   = orderInfo.Item.Name;
                    this.view.Cells[row, perCol * 11 + (int)Columns.specs].Text      = orderInfo.Item.Specs;
                    this.view.Cells[row, perCol * 11 + (int)Columns.comboNO].Text    = orderInfo.Combo.ID;
                    this.view.Cells[row, perCol * 11 + (int)Columns.hearbalQty].Text = orderInfo.HerbalQty.ToString();
                    this.view.Cells[row, perCol * 11 + (int)Columns.doseOnce].Text   = orderInfo.DoseOnce.ToString() + orderInfo.DoseUnit;
                    this.view.Cells[row, perCol * 11 + (int)Columns.frequence].Text  = orderInfo.Frequency.Name;
                    this.view.Cells[row, perCol * 11 + (int)Columns.usage].Text      = orderInfo.Usage.Name;
                    Neusoft.HISFC.Models.Pharmacy.Item phaItem = phaManagement.GetItem(orderInfo.Item.ID);
                    if (orderInfo.NurseStation.User03 == "1")
                    {
                        this.view.Cells[row, perCol * 11 + (int)Columns.totQty].Text = orderInfo.Qty.ToString() + orderInfo.Unit;
                    }
                    else
                    {
                        this.view.Cells[row, perCol * 11 + (int)Columns.totQty].Text = Convert.ToString(orderInfo.Qty * orderInfo.Item.PackQty) + phaItem.MinUnit;
                    }

                    this.view.Cells[row, perCol * 11 + (int)Columns.injectCount].Text = orderInfo.InjectCount.ToString();
                    this.view.Cells[row, perCol * 11 + (int)Columns.memo].Text        = orderInfo.Memo;

                    money += orderInfo.FT.OwnCost;
                }
            }

            if (orderInfo != null)
            {
                this.lblUsage.Text     = orderInfo.Usage.Name;
                this.lblFrequency.Text = orderInfo.Frequency.Name;
                this.lblTotQty.Text    = orderInfo.HerbalQty.ToString();
                this.lblIsProxy.Text   = orderInfo.Memo;
                this.lblSumMoney.Text  = money.ToString();
                this.lblRecipeNO.Text  = orderInfo.ReciptNO;
            }
        }
Example #2
0
        /// <summary>
        /// 在FarPoint增加一行
        /// [参数: FarPoint.Win.Spread.SheetView sheet - FarPoint页]
        /// [返回: 增加后的行号]
        /// </summary>
        /// <param name="sheet">FarPoint页</param>
        /// <returns>增加后的行号</returns>
        private int InsertRow(FarPoint.Win.Spread.SheetView sheet)
        {
            // 临时行号
            int row = 0;

            // 增加一行
            sheet.AddRows(sheet.RowCount, 1);
            // 获取行号
            row = sheet.RowCount - 1;
            // 返回行号
            return(row);
        }
        /// <summary>
        /// 设置FarPoint
        /// </summary>
        /// <param name="alDayBalance">实体数组</param>
        /// <param name="sheet">要显示的FarPoint</param>
        public void SetFarPoint(ArrayList alDayBalance, FarPoint.Win.Spread.SheetView sheet)
        {
            // 发票张数
            long invoiceCount = 0;
            // 实收金额
            decimal ownCost = 0;
            // 记帐金额
            decimal leftCost = 0;
            // 总金额
            decimal totalCost = 0;
            // 记帐单数量
            long accountCount = 0;
            // 行号
            int intRow = 0;

            // 清空FarPoint
            sheet.RowCount = 0;

            // 循环插值
            foreach (Class.ClinicDayBalance dayBalance in alDayBalance)
            {
                if (dayBalance.Memo != string.Empty)
                {
                    invoiceCount += long.Parse(dayBalance.Memo);
                }
                ownCost      += dayBalance.Cost.OwnCost;
                leftCost     += dayBalance.Cost.LeftCost;
                totalCost    += dayBalance.Cost.TotCost;
                accountCount += dayBalance.AccountNumber;

                // 插入新行
                sheet.AddRows(sheet.RowCount, 1);

                // 获取插入的行号
                intRow = sheet.RowCount - 1;

                // 发票号
                sheet.Cells[intRow, 0].Text = dayBalance.InvoiceNo;
                // 发票张数
                sheet.Cells[intRow, 1].Text = dayBalance.Memo;
                // 实收金额
                sheet.Cells[intRow, 2].Text = dayBalance.Cost.OwnCost.ToString();
                // 记帐金额
                sheet.Cells[intRow, 3].Text = dayBalance.Cost.LeftCost.ToString();
                // 总金额
                sheet.Cells[intRow, 4].Text = dayBalance.Cost.TotCost.ToString();
                // 记帐单数量
                sheet.Cells[intRow, 5].Text = dayBalance.AccountNumber.ToString();
                // 日结项目
                //if (dayBalance.BalanceItem == Neusoft.HISFC.Models.Base.CancelTypes.Valid)
                //{
                //    sheet.Cells[intRow, 6].Text = "正常";
                //}
                //else if (dayBalance.BalanceItem == Neusoft.HISFC.Models.Base.CancelTypes.Canceled)
                //{
                //    sheet.Cells[intRow, 6].Text = "退费";
                //}
                //else if (dayBalance.BalanceItem == Neusoft.HISFC.Models.Base.CancelTypes.Reprint)
                //{
                //    sheet.Cells[intRow, 6].Text = "重打";
                //}
                //else
                //{
                //    sheet.Cells[intRow, 6].Text = "注销";
                //}
            }

            //
            // 合计项目
            //
            // 插入新行
            sheet.AddRows(sheet.RowCount, 1);
            // 获取插入的行号
            intRow = sheet.RowCount - 1;
            // 赋值
            sheet.Cells[intRow, 0].Text = "合计";
            sheet.Cells[intRow, 1].Text = invoiceCount.ToString();
            sheet.Cells[intRow, 2].Text = ownCost.ToString();
            sheet.Cells[intRow, 3].Text = leftCost.ToString();
            sheet.Cells[intRow, 4].Text = totalCost.ToString();
            sheet.Cells[intRow, 5].Text = accountCount.ToString();
            sheet.Cells[intRow, 6].Text = "";

            //
            // 合并表格
            //
            //大写实收金额
            sheet.AddRows(sheet.RowCount, 1);
            intRow = sheet.RowCount - 1;
            sheet.Models.Span.Add(intRow, 0, 1, 7);
            sheet.Cells[intRow, 0].Text = "实收金额(大写): " + NConvert.ToCapital(decimal.Parse(sheet.Cells[intRow - 1, 4].Text));
            if (sheet.Cells[intRow - 1, 4].Text == "0")
            {
                sheet.Cells[intRow, 0].Text = "实收金额(大写): 零元零角零分";
            }
            // 操作员信息
            sheet.AddRows(sheet.RowCount, 1);
            intRow = sheet.RowCount - 1;
            sheet.Models.Span.Add(intRow, 0, 1, 3);
            sheet.Models.Span.Add(intRow, 3, 1, 4);
            sheet.Cells[intRow, 0].Text = "缴款人: " + this.currentOperator.Name;
            sheet.Cells[intRow, 3].Text = "收款员: " + this.currentOperator.Name;
            sheet.Cells[intRow, 3].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;

            // 填表人和出纳员
            sheet.AddRows(sheet.RowCount, 1);
            intRow = sheet.RowCount - 1;
            sheet.Models.Span.Add(intRow, 0, 1, 3);
            sheet.Models.Span.Add(intRow, 3, 1, 4);
            sheet.Cells[intRow, 0].Text = "填表人: " + "".PadLeft(this.currentOperator.Name.Length * 2, ' ');
            sheet.Cells[intRow, 3].Text = "出纳员: " + "".PadLeft(this.currentOperator.Name.Length * 2, ' ');
            sheet.Cells[intRow, 3].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;

            // 统计时间
            sheet.AddRows(sheet.RowCount, 1);
            intRow = sheet.RowCount - 1;
            sheet.Models.Span.Add(intRow, 0, 1, 7);
            if (this.tabControl1.SelectedIndex == 0)
            {
                sheet.Cells[intRow, 0].Text = "统计时间: " + this.lastDate + " 至 " + this.dayBalanceDate;
            }
            else
            {
                foreach (Class.ClinicDayBalance dayBalance in alDayBalance)
                {
                    sheet.Cells[intRow, 0].Text = "统计时间: " + dayBalance.BeginDate + " 至 " + dayBalance.EndDate;
                    return;
                }
            }
        }