예제 #1
0
 /// <summary>
 /// 打印门诊退药单据
 /// </summary>
 /// <param name="billMaster">单据表头</param>
 /// <param name="billOrder">单据明细</param>
 /// <param name="path">报表文件路径</param>
 /// <param name="Printer">打印人员</param>
 public override void PrintBill(HIS.Model.BillMaster billMaster, System.Data.DataTable billOrder, string path, int Printer)
 {
     if (billMaster == null)
     {
         return;
     }
     _printOrder = BillFactory.GetQuery(ConfigManager.OP_YF_REFUND).LoadOrder(billMaster);
     if (_printOrder.Rows.Count > 0)
     {
         HIS.Model.YP_DRMaster printMaster = (HIS.Model.YP_DRMaster)billMaster;
         report = new grproLib.GridppReport();
         report.LoadFromFile(path);
         report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
         report.ParameterByName("InvoiceNum").AsString   = printMaster.InvoiceNum.ToString();
         report.ParameterByName("UserName").AsString     = BaseData.GetUserName(printMaster.OPPeopleID);
         report.ParameterByName("ExeTime").AsDateTime    = printMaster.OPTime;
         report.ParameterByName("PatientName").AsString  = printMaster.PatientName;
         report.ParameterByName("HospitalName").AsString = BaseData.WorkName;
         report.ParameterByName("DocName").AsString      = BaseData.GetUserName(printMaster.DocID);
         report.ParameterByName("RecipeNo").AsString     = printMaster.RecipeID.ToString();
         report.ParameterByName("DeptName").AsString     = BaseData.GetDeptName(printMaster.DeptID.ToString());
         report.ParameterByName("Printer").AsString      = BaseData.GetUserName(Printer);
         report.ParameterByName("PrintTime").AsDateTime  = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
         report.PrintPreview(false);
     }
 }
예제 #2
0
 /// <summary>
 /// 供应商报表
 /// </summary>
 /// <param name="printCondition">进销存报表头</param>
 /// <param name="orderDt">进销存报表明细</param>
 /// <param name="path">报表文件路径</param>
 public override void PrintReport(YP_PrintCondition printCondition, System.Data.DataTable orderDt, string path)
 {
     try
     {
         if (orderDt != null)
         {
             if (orderDt.Rows.Count > 0)
             {
                 _printOrder = orderDt;
                 report      = new grproLib.GridppReport();
                 report.LoadFromFile(path);
                 report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                 report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
                 report.ParameterByName("btime").AsString        = printCondition.actYear;
                 report.ParameterByName("etime").AsString        = printCondition.actMonth;
                 report.ParameterByName("Printer").AsString      = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.GetUserName(printCondition.userId);
                 report.PrintPreview(false);
             }
         }
     }
     catch (Exception error)
     {
         throw error;
     }
 }
예제 #3
0
        //交款表打印
        private void Print(int accountType)
        {
            Controller.BeginChargeWorkid();

            zyAccount = new ZY_Account();
            Report    = new grproLib.GridppReport();

            if (accountType == 0)
            {
                chargeRpt.GetAccountRptInfo(chargeRpt, ids.ToArray(), accountType);

                #region 预交金
                Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院财务结帐预交金汇总.grf");
                GWI_DesReport.HisReport.FillRecordToReport(Report, chargeRpt);
                Report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(Report_FetchRecord);

                #endregion
            }
            else
            {
                #region 结算
                Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院财务结帐结算汇总.grf");
                costRpt.GetAccountRptInfo(costRpt, ids.ToArray(), accountType);
                GWI_DesReport.HisReport.FillRecordToReport(Report, costRpt);

                for (int i = 0; i < costRpt.发票项目.Rows.Count; i++)
                {
                    try
                    {
                        Report.ParameterByName(costRpt.发票项目.Rows[i]["itemname"].ToString()).AsString = costRpt.发票项目.Rows[i]["Tolal_Fee"].ToString();
                    }
                    catch (Exception err)
                    {
                        MessageBox.Show("发票打印传入参数:发票项目_" + costRpt.发票项目.Rows[i]["itemname"].ToString() + " 错误\r\n" + err.Message);
                        continue;
                    }
                }

                for (int i = 0; i < costRpt.记账内容.Length; i++)
                {
                    try
                    {
                        Report.ParameterByName(costRpt.记账内容[i].TypeName + "_记账_张数").AsString = costRpt.记账内容[i].CostNum;
                        Report.ParameterByName(costRpt.记账内容[i].TypeName + "_记账").AsString    = costRpt.记账内容[i].CostFee;
                    }
                    catch (Exception err)
                    {
                        MessageBox.Show("发票打印传入参数:记账类型_" + costRpt.记账内容[i].TypeName + " 错误\r\n" + err.Message);
                        continue;
                    }
                }

                #endregion
            }

            Controller.EndChargeWorkid();

            //zyAccount.UpdatePrintNum(Accountid);
            Report.PrintPreview(false);
        }
예제 #4
0
 /// <summary>
 /// 打印住院统领单据
 /// </summary>
 /// <param name="billMaster">单据表头</param>
 /// <param name="billOrder">单据明细</param>
 /// <param name="path">报表文件路径</param>
 /// <param name="Printer">打印人员</param>
 public override void PrintBill(HIS.Model.BillMaster billMaster, System.Data.DataTable billOrder, string path, int Printer)
 {
     if (billMaster == null || billOrder == null)
     {
         return;
     }
     HIS.Model.YP_DispDeptHis printMaster = (HIS.Model.YP_DispDeptHis)billMaster;
     if (billOrder.Rows.Count > 0)
     {
         _printOrder = billOrder;
         report      = new grproLib.GridppReport();
         report.LoadFromFile(path);
         report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
         report.ParameterByName("DeptName").AsString     = BaseData.GetDeptName(printMaster.DeptId.ToString());
         report.ParameterByName("UserName").AsString     = BaseData.GetUserName(printMaster.OpMan);
         report.ParameterByName("ExeTime").AsDateTime    = printMaster.OpTime;
         report.ParameterByName("DispDept").AsString     = BaseData.GetDeptName(printMaster.DispDept.ToString());
         report.ParameterByName("PrintTime").AsDateTime  = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
         report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName
                                                           + printMaster.BillType + "统领发药单";
         report.ParameterByName("Printer").AsString      = BaseData.GetUserName(Printer);
         report.ParameterByName("PrintTime").AsDateTime  = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
         report.ParameterByName("PatientNames").AsString = printMaster.PatientNames;
         report.PrintPreview(false);
     }
 }
예제 #5
0
        /// <summary>
        /// 报表打印
        /// </summary>
        private void ReportPrint(bool view)
        {
            if (dgvReport.Rows.Count == 0)
            {
                return;
            }
            if (dgvReport.DataSource == null)
            {
                return;
            }
            reportPrinter = new grproLib.GridppReport( );
            string reportFile = System.Windows.Forms.Application.StartupPath + "\\report\\" + FormTitle + ".grf";

            if (!System.IO.File.Exists(reportFile))
            {
                MessageBox.Show("报表模板文件不存在,不能打印或预览!请下载或联系管理员增加该报表", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            reportPrinter.LoadFromFile(reportFile);
            string printerName = HIS_PublicManager.PublicPrintSet.GetPrinterNameByReport(FormTitle + ".grf");

            reportPrinter.Printer.PrinterName = printerName;

            try
            {
                reportPrinter.Title = FormTitle;
                try
                {
                    reportPrinter.ParameterByName("医院名称").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
                    reportPrinter.ParameterByName("报表标题").AsString = FormTitle;
                    reportPrinter.ParameterByName("统计时间").AsString = "统计日期:" + this.lblDate.Text;
                    reportPrinter.ParameterByName("制表人").AsString  = "制表人:" + currentUser.Name;
                    reportPrinter.ParameterByName("备注").AsString   = "";
                }
                catch (Exception err)
                {
                    throw new Exception("报表模板参数没有正确设置,请用设计器打开报表并设置好参数");
                }
                reportPrinter.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                if (view)
                {
                    reportPrinter.PrintPreview(false);
                }
                else
                {
                    reportPrinter.Print(true);
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
예제 #6
0
 /// <summary>
 /// 打印调价单
 /// </summary>
 /// <param name="billMaster">单据表头</param>
 /// <param name="billOrder">单据明细</param>
 /// <param name="path">报表文件路径</param>
 /// <param name="Printer">打印人员</param>
 public override void PrintBill(HIS.Model.BillMaster billMaster, System.Data.DataTable billOrder, string path, int Printer)
 {
     if (billMaster == null || billOrder == null)
     {
         return;
     }
     HIS.Model.YP_AdjMaster printMaster = (HIS.Model.YP_AdjMaster)billMaster;
     if (billOrder.Rows.Count > 0)
     {
         _printOrder = billOrder;
         report      = new grproLib.GridppReport();
         report.LoadFromFile(path);
         report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
         report.ParameterByName("BillNo").AsString       = printMaster.BillNum.ToString();
         report.ParameterByName("AdjCode").AsString      = printMaster.AdjCode;
         report.ParameterByName("BillDate").AsDateTime   = printMaster.RegTime;
         report.ParameterByName("Remark").AsString       = printMaster.Remark;
         report.ParameterByName("RegPeople").AsString    = BaseData.GetUserName(printMaster.RegPeople);
         report.ParameterByName("RegDept").AsString      = BaseData.GetDeptName(printMaster.DeptID.ToString());
         report.ParameterByName("HospitalName").AsString = BaseData.WorkName;
         report.ParameterByName("Printer").AsString      = BaseData.GetUserName(Printer);
         report.ParameterByName("PrintTime").AsDateTime  = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
         report.PrintPreview(false);
     }
 }
예제 #7
0
        /// <summary>
        /// 打印明细账报表
        /// </summary>
        /// <param name="printCondition">报表头</param>
        /// <param name="orderDt">报表明细</param>
        /// <param name="path">报表文件路径</param>
        public override void PrintReport(YP_PrintCondition printCondition, System.Data.DataTable orderDt, string path)
        {
            if (printCondition == null || orderDt == null)
            {
                return;
            }
            YP_AccountCondition actCondition = (YP_AccountCondition)printCondition;

            if (orderDt.Rows.Count > 0)
            {
                _printOrder = orderDt;
                report      = new grproLib.GridppReport();
                report.LoadFromFile(path);
                report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                report.ParameterByName("AccountYear").AsString  = actCondition.actYear;
                report.ParameterByName("AccountMonth").AsString = actCondition.actMonth;
                report.ParameterByName("DrugName").AsString     = actCondition.drugName;
                report.ParameterByName("ProductName").AsString  = actCondition.productName;
                report.ParameterByName("BeginNum").AsString     = actCondition.beginNum;
                report.ParameterByName("BeginFee").AsString     = actCondition.begingFee;
                report.ParameterByName("EndNum").AsString       = actCondition.endNum;
                report.ParameterByName("EndFee").AsString       = actCondition.endFee;
                report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
                report.PrintPreview(false);
            }
        }
예제 #8
0
 private void btPrint_Click(object sender, EventArgs e)
 {
     if (this.dgvDrug.CurrentCell != null)
     {
         DataTable dt       = (DataTable)this.dgvDrug.DataSource;
         int       RowIndex = this.dgvDrug.CurrentCell.RowIndex;
         Report = new grproLib.GridppReport();
         Report.LoadFromFile(HIS.SYSTEM.PubicBaseClasses.Constant.ApplicationDirectory + "\\report\\护士统领汇总单据.grf");
         Report.ParameterByName("UserName").AsString     = data[6];
         Report.ParameterByName("ExeTime").AsString      = data[0];
         Report.ParameterByName("DeptName").AsString     = BaseNameFactory.GetName(baseNameType.科室名称, data[1]);
         Report.ParameterByName("DispDept").AsString     = BaseNameFactory.GetName(baseNameType.科室名称, data[2]);
         Report.ParameterByName("Printer").AsString      = _currentUser.Name;
         Report.ParameterByName("PrintTime").AsString    = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime.ToString();
         Report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
         //List<string> patNames = new List<string>();
         //int masterID = Convert.ToInt32(dsMessageData.dtMessageMaster.Rows[RowIndex]["DRUGMESSAGEID"].ToString().Trim());
         //string patname = "";
         //DataRow[] drs = dsMessageData.dtMessageOrder.Select("masterid=" + masterID);
         //for (int i = 0; i < drs.Length; i++)
         //{
         //    string patS = patNames.Find(delegate(string y) { return y == drs[i]["patname"].ToString(); });
         //    if (patS == null)
         //    {
         //        patNames.Add(drs[i]["patname"].ToString());
         //        patname += drs[i]["patname"].ToString() + ",";
         //    }
         //}
         //if (patname != "") patname = patname.Substring(0, patname.Length - 1);
         Report.ParameterByName("PatientNames").AsString = "";
         Report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(Report_FetchRecord);
         Report.PrintPreview(false);
     }
 }
예제 #9
0
 /// <summary>
 /// 打印采购计划单
 /// </summary>
 /// <param name="billMaster">单据表头</param>
 /// <param name="billOrder">单据明细</param>
 /// <param name="path">报表文件路径</param>
 /// <param name="Printer">打印人员</param>
 public override void PrintBill(HIS.Model.BillMaster billMaster, System.Data.DataTable billOrder, string path, int Printer)
 {
     try
     {
         HIS.Model.YP_PlanMaster printMaster = (HIS.Model.YP_PlanMaster)billMaster;
         _printOrder = BillFactory.GetQuery(ConfigManager.OP_YK_STOCKPLAN).LoadOrder(printMaster);
         if (printMaster != null && _printOrder.Rows.Count > 0)
         {
             report = new grproLib.GridppReport();
             report.LoadFromFile(path);
             report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
             report.ParameterByName("RegTime").AsDateTime      = printMaster.RegTime;
             report.ParameterByName("RegPeopleName").AsString  = printMaster.RegPeopleName;
             report.ParameterByName("TotalRetailFee").AsString = printMaster.RetailFee.ToString();
             report.ParameterByName("TotalTradeFee").AsString  = printMaster.TradeFee.ToString();
             report.ParameterByName("HospitalName").AsString   = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
             report.ParameterByName("Printer").AsString        = BaseData.GetUserName(Printer);
             report.ParameterByName("PrintTime").AsDateTime    = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
             report.ParameterByName("DiffFee").AsString        = (printMaster.RetailFee - printMaster.TradeFee).ToString();
             report.PrintPreview(false);
         }
     }
     catch (Exception error)
     {
         throw error;
     }
 }
예제 #10
0
 private void ctrlReport1_ReportInit(grproLib.GridppReport report)
 {
     try
     {
         report.ParameterByName("ParamBillID").Value = this._BillID;
     }
     catch (Exception ex)
     {
         ErrorHandler.OnError(ex);
     }
 }
예제 #11
0
 /// <summary>
 /// 打印启用药品
 /// </summary>
 /// <param name="path">报表文件路径</param>
 /// <param name="printer">打印人</param>
 /// <param name="deptId">部门ID</param>
 /// <param name="drugInfo">药品信息表</param>
 static public void PrintUseDrug(string path, int printer, int deptId, DataTable drugInfo)
 {
     try
     {
         _printOrder = drugInfo;
         if (path != "" && drugInfo.Rows.Count > 0)
         {
             report = new grproLib.GridppReport();
             report.LoadFromFile(path);
             report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
             report.ParameterByName("Printer").AsString      = BaseData.GetUserName(printer);
             report.ParameterByName("DeptName").AsString     = BaseData.GetDeptName(deptId.ToString());
             report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
             report.ParameterByName("PrintTime").AsDateTime  = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
             report.PrintPreview(false);
         }
     }
     catch (Exception error)
     {
         throw error;
     }
 }
예제 #12
0
        void SetParameters(ReportParameter[] parameters)
        {
            bool changed = false;

            if (parameters != null)
            {
                for (int i = 0; i < parameters.Length; i++)
                {
                    if (grdrpt.Parameters.IndexByName(parameters[i].Name) == -1)
                    {
                        grproLib.IGRParameter parameter = grdrpt.Parameters.Add();
                        parameter.Name = parameters[i].Name;
                        changed        = true;
                    }
                    //else
                    grdrpt.ParameterByName(parameters[i].Name).AsString = parameters[i].Value.ToString();
                }
                if (changed)
                {
                    grdrpt.SaveToFile(FullReportTemplateFileName);
                }
            }
        }
예제 #13
0
        //打印住院发票
        public static void Print(int CostMasterID)
        {
            grproLib.GridppReport Report = new grproLib.GridppReport();
            string ReportPath;
            string PrinterName;
            Object invoice;

            //广东发票打印
            //ReportPath = Constant.ApplicationDirectory + "\\report\\住院发票.grf";
            //PrinterName = HIS_PublicManager.PublicPrintSet.GetPrinterNameByReport("住院发票.grf");
            //invoice =InvoiceFactory.CreateInvoice(CostMasterID,"广东");
            //湖南发票打印
            ReportPath  = Constant.ApplicationDirectory + "\\report\\住院发票_HN.grf";
            PrinterName = HIS_PublicManager.PublicPrintSet.GetPrinterNameByReport("住院发票_HN.grf");
            invoice     = InvoiceFactory.CreateInvoice(CostMasterID, "湖南");


            Report.LoadFromFile(ReportPath);
            Report.Printer.PrinterName = PrinterName;
            GWI_DesReport.HisReport.FillRecordToReport(Report, invoice);
            Report.ParameterByName("WorkName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;

            #region 发票项目
            DataTable dt = ((AbstractInvoice)invoice).发票项目费用;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                for (int j = 1; j <= Report.Parameters.Count; j++)
                {
                    if (dt.Rows[i]["itemname"].ToString().Trim() == Report.Parameters[j].Name)
                    {
                        Report.Parameters[j].Value = dt.Rows[i]["Tolal_Fee"].ToString();
                    }
                }
            }
            #endregion

            if (Report.Printer.PrinterName == null || Report.Printer.PrinterName == "")
            {
                MessageBox.Show("请先设置好此报表的打印机!", "询问", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                return;
            }
#if DEBUG
            Report.PrintPreview(false);
#else
            //Report.PrintPreview(false);
            Report.Print(false);
#endif
        }
예제 #14
0
        static public void PrintTotalInOutStore(string path, PrintCondition condition, DataTable totalOrder)
        {
            _printOrder = totalOrder;
            if (path != "" && totalOrder != null)
            {
                if (totalOrder.Rows.Count <= 0)
                {
                    return;
                }
                else
                {
                    report = new grproLib.GridppReport();
                    report.LoadFromFile(path);
                    report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);

                    report.ParameterByName("开始时间").AsDateTime = condition.beginTime;
                    report.ParameterByName("结束时间").AsDateTime = condition.endTime;
                    if (condition.exeDeptId != 0)
                    {
                        report.ParameterByName("统计科室").AsString = BaseData.GetDeptName(condition.exeDeptId.ToString());
                    }
                    else
                    {
                        report.ParameterByName("统计科室").AsString = "全部库房(含物资与药库)";
                    }
                    report.ParameterByName("打印人员").AsString   = BaseData.GetUserName(condition.printer);
                    report.ParameterByName("打印时间").AsDateTime = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
                    if (condition.billNo == "0")
                    {
                        report.ParameterByName("标题").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName
                                                                + "入库统计单";
                    }
                    else
                    {
                        report.ParameterByName("标题").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName
                                                                + "出库统计单";
                    }
                    report.PrintPreview(false);
                }
            }
        }
예제 #15
0
 private void toolStripButton4_Click(object sender, EventArgs e)
 {
     if (this.dataGridViewEx1.CurrentCell != null)
     {
         int RowIndex = this.dataGridViewEx1.CurrentCell.RowIndex;
         Report = new grproLib.GridppReport();
         Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\护士统领汇总单据.grf");
         Report.ParameterByName("UserName").AsString     = dsMessageData.dtMessageMaster.Rows[RowIndex]["SENDERNAME"].ToString().Trim();
         Report.ParameterByName("ExeTime").AsString      = dsMessageData.dtMessageMaster.Rows[RowIndex]["SENDTIME"].ToString().Trim();
         Report.ParameterByName("DeptName").AsString     = dsMessageData.dtMessageMaster.Rows[RowIndex]["presdeptname"].ToString().Trim();
         Report.ParameterByName("DispDept").AsString     = dsMessageData.dtMessageMaster.Rows[RowIndex]["dispDeptName"].ToString().Trim();
         Report.ParameterByName("Printer").AsString      = _currentUser.Name;
         Report.ParameterByName("PrintTime").AsString    = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime.ToString();
         Report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
         List <string> patNames = new List <string>();
         int           masterID = Convert.ToInt32(dsMessageData.dtMessageMaster.Rows[RowIndex]["DRUGMESSAGEID"].ToString().Trim());
         string        patname  = "";
         DataRow[]     drs      = dsMessageData.dtMessageOrder.Select("masterid=" + masterID);
         for (int i = 0; i < drs.Length; i++)
         {
             string patS = patNames.Find(delegate(string y) { return(y == drs[i]["patname"].ToString()); });
             if (patS == null)
             {
                 patNames.Add(drs[i]["patname"].ToString());
                 patname += drs[i]["patname"].ToString() + ",";
             }
         }
         if (patname != "")
         {
             patname = patname.Substring(0, patname.Length - 1);
         }
         Report.ParameterByName("PatientNames").AsString = patname;
         Report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(Report_FetchRecord);
         Report.PrintPreview(false);
     }
 }
예제 #16
0
        //打印
        private void toolSBPrint_Click(object sender, EventArgs e)
        {
            if (((DataTable)this.dgBill.DataSource).Rows.Count == 0)
            {
                return;
            }
            if (Convert.ToInt32(((DataTable)this.dgBill.DataSource).DefaultView.ToTable().Rows[this.dgBill.CurrentCell.RowIndex]["Record_Flag"]) != 0 || Convert.ToInt32(((DataTable)this.dgBill.DataSource).DefaultView.ToTable().Rows[this.dgBill.CurrentCell.RowIndex]["Delete_Flag"]) != 0)
            {
                MessageBox.Show("此条是做废记录或已经结算,不能打印!");
                return;
            }
            if (MessageBox.Show("确定要打印吗?", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK)
            {
                zy_ChargeList = (ZY_ChargeList)HIS.SYSTEM.PubicBaseClasses.ApiFunction.DataTableToObject(((DataTable)this.dgBill.DataSource).Copy(), this.dgBill.CurrentCell.RowIndex, zy_ChargeList);

                grproLib.GridppReport Report = new grproLib.GridppReport();
                string reportPath            = Constant.ApplicationDirectory + "\\report\\住院收费收据.grf";
                Report.LoadFromFile(reportPath);
                GWI_DesReport.HisReport.FillRecordToReport(Report, zy_ChargeList);
                Report.ParameterByName("PatName").AsString     = zy_PatList.patientInfo.PatName;
                Report.ParameterByName("DeptName").AsString    = this.tbpatDept.Text;
                Report.ParameterByName("BedNO").AsString       = zy_PatList.BedCode;
                Report.ParameterByName("Total_Fee1").AsString  = zy_ChargeList.Total_Fee.ToString();
                Report.ParameterByName("PrintPerson").AsString = base.currentUser.Name;
                Report.ParameterByName("WorkName").AsString    = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
                Report.Printer.PrinterName = HIS_PublicManager.PublicPrintSet.GetPrinterNameByReport("住院收费收据.grf");
                if (Report.Printer.PrinterName == null || Report.Printer.PrinterName == "")
                {
                    MessageBox.Show("请先设置好此报表的打印机!", "询问", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                    return;
                }
                if (this.printType.Checked)
                {
                    Report.Print(false);
                }
                else
                {
                    Report.PrintPreview(false);
                }
            }
        }
예제 #17
0
        /// <summary>
        /// 打印摆药单据
        /// </summary>
        /// <param name="printCondition">打印头信息</param>
        /// <param name="orderDt">打印明细</param>
        /// <param name="path">报表路径</param>
        public override void PrintReport(YP_PrintCondition printCondition, System.Data.DataTable orderDt, string path)
        {
            if (orderDt == null)
            {
                return;
            }
            if (orderDt.Rows.Count > 0)
            {
                HIS.Interface.IZY_Data zyInterFace = new HIS.Interface.ZY_Data();
                _printOrder = new DataTable();
                DateTime currentTime = XcDate.ServerDateTime;
                _printOrder.Columns.Add("OrderContents", Type.GetType("System.String"));
                _printOrder.Columns.Add("PatName", Type.GetType("System.String"));
                _printOrder.Columns.Add("PatAge", Type.GetType("System.String"));
                _printOrder.Columns.Add("BedNo", Type.GetType("System.String"));
                _printOrder.Columns.Add("OrderId", Type.GetType("System.Int32"));
                _printOrder.Columns.Add("ChargeDate", Type.GetType("System.DateTime"));
                _printOrder.Columns.Add("UnitName", Type.GetType("System.String"));
                _printOrder.Columns.Add("CureNo", Type.GetType("System.String"));
                _printOrder.Columns.Add("DrugNum", Type.GetType("System.Decimal"));
                _printOrder.Columns.Add("PresDeptName", Type.GetType("System.String"));
                _printOrder.Columns.Add("SortNum", Type.GetType("System.Int32"));
                _printOrder.PrimaryKey = new DataColumn[] { _printOrder.Columns["OrderId"], _printOrder.Columns["CureNo"] };
                //如果只打口服摆药单
                if (printCondition.drugType == "口服药")
                {
                    for (int index = 0; index < orderDt.Rows.Count; index++)
                    {
                        //按医嘱ID获取用法对应执行单表
                        DataTable useTypeDt = zyInterFace.GetUseType(Convert.ToInt32(orderDt.Rows[index]["docorderid"]));                        if (useTypeDt != null)
                        {
                            //如果是口服药
                            if (useTypeDt.Select("TYPE_NAME='服药单'").Count() == 0)
                            {
                                orderDt.Rows[index]["ISDISPENSE"] = 0;
                            }
                        }
                    }
                }
                for (int index = 0; index < orderDt.Rows.Count; index++)
                {
                    DataRow currentRow = orderDt.Rows[index];
                    if (currentRow["ISDISPENSE"] == DBNull.Value)
                    {
                        continue;
                    }
                    if (Convert.ToInt32(currentRow["ISDISPENSE"]) == 0)
                    {
                        continue;
                    }
                    DataRow findRow = _printOrder.Rows.Find(new object[] { currentRow["docorderid"], currentRow["cureno"] });
                    if (findRow != null)
                    {
                        findRow["DrugNum"] = Convert.ToDecimal(findRow["DrugNum"])
                                             + Convert.ToDecimal(currentRow["DrugNum"]);
                    }
                    else
                    {
                        DataRow newRow = _printOrder.NewRow();
                        newRow["OrderContents"] = zyInterFace.GetDocOrderInfo(Convert.ToInt32(currentRow["docorderid"]));
                        newRow["PatName"]       = currentRow["patname"];
                        string bedNo = currentRow["bedno"].ToString();
                        newRow["SortNum"]      = Convert.ToInt32(bedNo.Replace("加", "100").ToString());
                        newRow["BedNo"]        = bedNo;
                        newRow["OrderId"]      = currentRow["docorderid"];
                        newRow["ChargeDate"]   = currentRow["chargedate"];
                        newRow["UnitName"]     = currentRow["unitname"];
                        newRow["CureNo"]       = currentRow["cureno"];
                        newRow["DrugNum"]      = currentRow["drugnum"];
                        newRow["PresDeptName"] = currentRow["presdeptname"];
                        newRow["PatAge"]       = zyInterFace.GetPatAge(newRow["CureNo"].ToString(), currentTime);
                        _printOrder.Rows.Add(newRow);
                    }
                }
                DataRow[] dRows = _printOrder.Select("", "SortNum");
                DataTable newDt = _printOrder.Clone();
                foreach (DataRow dRow in dRows)
                {
                    newDt.Rows.Add(dRow.ItemArray);
                }
                _printOrder = newDt;
                if (_printOrder.Rows.Count > 0)
                {
                    report = new grproLib.GridppReport();
                    report.LoadFromFile(path);
                    report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                    string type = "";
                    switch (printCondition.queyType)
                    {
                    case 0:
                        type = "长期";
                        break;

                    case 1:
                        type = "临时";
                        break;

                    default:
                        break;
                    }
                    report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName
                                                                      + type + "住院药品摆药单";
                    report.ParameterByName("PrintTime").AsDateTime = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
                    report.ParameterByName("Printer").AsString     = BaseData.GetUserName(printCondition.userId);
                    report.PrintPreview(false);
                }
            }
        }
예제 #18
0
        static public void PrintCheckReport(string path, PrintCondition condition, DataTable drugInfo)
        {
            try
            {
                _printOrder = drugInfo;
                if (path != "" && drugInfo.Rows.Count > 0)
                {
                    report = new grproLib.GridppReport();
                    report.LoadFromFile(path);
                    report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);

                    report.ParameterByName("审核单号").AsString     = condition.billNo;
                    report.ParameterByName("盘点开始时间").AsDateTime = condition.beginTime;
                    report.ParameterByName("盘存库房").AsString     = BaseData.GetDeptName(condition.exeDeptId.ToString());
                    report.ParameterByName("盘盈金额").AsString     = condition.reportFees["盘盈金额"].ToString();
                    report.ParameterByName("盘亏金额").AsString     = condition.reportFees["盘亏金额"].ToString();
                    report.ParameterByName("盘后金额合计").AsString   = condition.reportFees["盘存金额"].ToString();
                    report.ParameterByName("盘点结束时间").AsDateTime = condition.endTime;
                    report.ParameterByName("打印人员").AsString     = BaseData.GetUserName(condition.printer);
                    report.ParameterByName("审核人员").AsString     = condition.exePeoples;
                    report.ParameterByName("医院名称").AsString     = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
                    report.ParameterByName("打印时间").AsDateTime   = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
                    report.PrintPreview(false);
                }
            }
            catch (Exception error)
            {
                throw error;
            }
        }
예제 #19
0
 public override void Print(string path, HIS.Model.ZY_PatList patlist, List <HIS.Model.ZY_DOC_ORDERRECORD> applys, DateTime dtime, string name, string sample, string deptname, string diagname)
 {
     if (path != "" && applys.Count > 0)
     {
         string  itemname = applys[0].ORDER_CONTENT.ToString();
         decimal price    = applys[0].ORDER_PRICE;
         for (int i = 1; i < applys.Count; i++)
         {
             itemname = itemname + ", " + applys[i].ORDER_CONTENT.ToString();
             price    = price + applys[i].ORDER_PRICE;
         }
         report = new grproLib.GridppReport();
         report.LoadFromFile(path);
         report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
         report.ParameterByName("打印人").AsString  = name;
         report.ParameterByName("医院名称").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
         report.ParameterByName("住院号").AsString  = patlist.CureNo;
         report.ParameterByName("病人姓名").AsString = patlist.PatientInfo.PatName;
         report.ParameterByName("病人性别").AsString = patlist.PatientInfo.PatSex;
         string age = HIS.SYSTEM.PubicBaseClasses.Age.GetAgeString(patlist.PatientInfo.PatBriDate, XcDate.ServerDateTime, 1);
         report.ParameterByName("病人年龄").AsString = age;
         string[] strdiag = patlist.DiseaseName.Split(new char[] { '|' });
         if (strdiag[0] == "")
         {
             report.ParameterByName("诊断").AsString = strdiag[1].Replace("\r\n", "");
         }
         else
         {
             report.ParameterByName("诊断").AsString = strdiag[0].Replace("\r\n", "");
         }
         report.ParameterByName("申请时间").AsString    = dtime.ToString();
         report.ParameterByName("申请科室").AsString    = deptname;
         report.ParameterByName("Purpose").AsString = itemname;
         report.ParameterByName("床号").AsString      = patlist.BedCode;
         report.ParameterByName("项目金额").AsString    = price.ToString() + " 元";
         report.ParameterByName("标本").AsString      = sample;
         report.ParameterByName("申请医生").AsString    = name;
         report.PrintPreview(false);
     }
 }
예제 #20
0
        //打印主功能
        private void PrintMain(bool IsPreview, string presdeptcode)
        {
            Report = new grproLib.GridppReport();

            IcostManager icM = ObjectFactory.GetObject <IcostManager>(typeof(ZY_CostMaster));

            icM.PatListID = zy_pat.PatListID;
            PatFee patFee = icM.GetPatFee(this.dtpE.Value.Date);


            if (this.radioButton1.Checked)
            {
                Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单_汇总.grf");
            }
            else if (this.radioButton2.Checked)
            {
                Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单_核算.grf");
            }
            else if (this.radioButton3.Checked)
            {
                Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单.grf");
            }
            else if (this.radioButton4.Checked)
            {
                Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用清单_汇总分组.grf");
            }
            else if (this.radioButton5.Checked)
            {
                Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院费用一日清单.grf");
            }
            if (checkBox1.Checked == true)
            {
                Report.ParameterByName("费用时间").AsString = this.dtpB.Value.ToString("yyyy-MM-dd HH:mm:ss") + "至" + this.dtpE.Value.ToString("yyyy-MM-dd HH:mm:ss");
            }
            else
            {
                string date1, date2;
                if (zy_pat.OutDate.Date.ToString("yyyy-MM-dd") == "0001-01-01")
                {
                    date2 = "至今";
                }
                else
                {
                    date2 = zy_pat.OutDate.Date.ToString("yyyy-MM-dd") + " 23:59:59";
                }
                date1 = zy_pat.CureDate.ToString("yyyy-MM-dd HH:mm:ss");

                Report.ParameterByName("费用时间").AsString = date1 + "至" + date2;
            }
            if (this.radioButton5.Checked)
            {
                Report.ParameterByName("费用时间").AsString = this.dtpB.Value.ToString("yyyy-MM-dd HH:mm:ss");
            }

            Report.ParameterByName("CureNo").AsString    = zy_pat.CureNo;
            Report.ParameterByName("PatCaseNo").AsString = zy_pat.patientInfo.PatCaseNo;
            Report.ParameterByName("PatName").AsString   = zy_pat.patientInfo.PatName;

            string DateStr = zy_pat.OutDate.Date.ToString("yyyy-MM-dd");

            if (DateStr == "0001-01-01")
            {
                DateStr = zy_pat.CureDate.Date.ToString("yyyy-MM-dd");
            }
            else
            {
                DateStr = zy_pat.CureDate.Date.ToString("yyyy-MM-dd") + "至" + DateStr;
            }
            Report.ParameterByName("MarkDate").AsString = DateStr;
            Report.ParameterByName("BedCode").AsString  = zy_pat.BedCode;
            if (presdeptcode == null)
            {
                Report.ParameterByName("住院科室").AsString = BaseNameFactory.GetName(baseNameType.科室名称, zy_pat.CurrDeptCode);
            }
            else
            {
                Report.ParameterByName("住院科室").AsString = BaseNameFactory.GetName(baseNameType.科室名称, presdeptcode);
            }
            Report.ParameterByName("WorkName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;

            if (zy_pat.PatType == "4" || zy_pat.PatType == "5")
            {
                //Report.ParameterByName("累计交费").AsString = "0";
                //try
                //{
                //    ZY_CostMaster zyCM = new ZY_CostMaster();
                //    Report.ParameterByName("农合医保记账").AsString = zyCM.GetSumVillage_Fee(zy_pat.PatListID).ToString("0.00");
                //}
                //catch { }
                //Report.ParameterByName("余额").AsString = "0";
                icM = icM.GetCostMaster(zy_pat.PatListID);
                Report.ParameterByName("累计交费").AsString = icM.Deptosit_Fee.ToString();
                Report.ParameterByName("累计记账").AsString = icM.Total_Fee.ToString();
                Report.ParameterByName("余额").AsString   = Convert.ToString(icM.Deptosit_Fee - icM.Total_Fee);
            }
            else
            {
                Report.ParameterByName("累计交费").AsString = patFee.chargeFee.ToString();
                Report.ParameterByName("累计记账").AsString = patFee.costFee.ToString();
                Report.ParameterByName("余额").AsString   = patFee.surplusFee.ToString();
            }
            //ShowItemData(); 移动在Print()中
            try
            {
                Report.ParameterByName("甲类总金额").AsString = firstFee.ToString();
                Report.ParameterByName("乙类总金额").AsString = secondFee.ToString();
                Report.ParameterByName("本次优惠").AsString  = AllDec.ToString();

                Report.ParameterByName("担保金额").AsString = zy_pat.DbFee.ToString("0.00");
                //Report.ParameterByName("自付金额").AsString = Convert.ToString(patFee.costFee - firstFee - secondFee);
            }
            catch { }
            if (this.radioButton5.Checked)
            {
                for (int i = 0; i < ItemDt.Rows.Count; i++)
                {
                    for (int j = 1; j <= Report.Parameters.Count; j++)
                    {
                        if (ItemDt.Rows[i]["itemname"].ToString().Trim() == Report.Parameters[j].Name)
                        {
                            Report.Parameters[j].Value = ItemDt.Rows[i]["Tolal_Fee"].ToString();
                        }
                    }
                }
            }
            else
            {
                Report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(Report_FetchRecord);
            }
            if (IsPreview)
            {
                Report.PrintPreview(false);
            }
            else
            {
                Report.Print(false);
            }
        }
예제 #21
0
        /// <summary>
        /// 打印出库单据
        /// </summary>
        /// <param name="billMaster">单据表头</param>
        /// <param name="billOrder">单据明细</param>
        /// <param name="path">报表文件路径</param>
        /// <param name="Printer">打印人员</param>
        public override void PrintBill(HIS.Model.BillMaster billMaster, System.Data.DataTable billOrder, string path, int Printer)
        {
            HIS.Model.YP_OutMaster printMaster = (HIS.Model.YP_OutMaster)billMaster;
            if (printMaster != null && billOrder != null)
            {
                if (billOrder.Rows.Count > 0)
                {
                    DataTable dtt = billOrder.Copy();
                    bool      isShowTradePrice = ConfigManager.ManageTradepriceByYF();
                    if (!isShowTradePrice)
                    {
                        _printOrder.Columns.Remove("TRADEPRICE");
                        _printOrder.Columns.Remove("TRADEFEE");
                        _printOrder.Columns.Remove("DIFFFEE");
                    }

                    DataColumn dc = null;
                    dc = dtt.Columns.Add("OVERNUM", Type.GetType("System.String"));//增加结余数 zhangyunhui 5.8
                    for (int i = 0; i < dtt.Rows.Count; i++)
                    {
                        dtt.Rows[i]["OVERNUM"] = Getovernumber(Convert.ToInt32(dtt.Rows[i]["OUTSTORAGEID"].ToString()));
                    }
                    _printOrder = dtt;

                    if (printMaster.OpType == ConfigManager.OP_YK_REPORTLOSS)
                    {
                        report = new grproLib.GridppReport();
                        string startPath = path + "\\report\\药品报损出库单据.grf";
                        report.LoadFromFile(startPath);
                        report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                    }
                    else
                    {
                        report = new grproLib.GridppReport();
                        string startPath = path + "\\report\\科室领药出库单据.grf";
                        report.LoadFromFile(startPath);
                        report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                        report.ParameterByName("OutDept").AsString = BaseData.GetDeptName(printMaster.OutDeptId.ToString());
                    }
                    report.ParameterByName("BillNo").AsString = printMaster.BillNum.ToString();
                    if (printMaster.Audit_Flag == 0)
                    {
                        report.ParameterByName("ExeTime").AsString   = printMaster.RegTime.ToString();
                        report.ParameterByName("RegPeople").AsString = BaseData.GetUserName(printMaster.RegPeopleID);
                    }
                    else
                    {
                        report.ParameterByName("ExeTime").AsString   = printMaster.AuditTime.ToString();
                        report.ParameterByName("RegPeople").AsString = BaseData.GetUserName(printMaster.AuditPeopleID);
                    }
                    report.ParameterByName("RegDept").AsString        = BaseData.GetDeptName(printMaster.DeptID.ToString());
                    report.ParameterByName("Remark").AsString         = printMaster.ReMark;
                    report.ParameterByName("TotalRetailFee").AsString = printMaster.RetailFee.ToString();
                    string billType = DrugBaseDataBll.FindDrugDept(printMaster.DeptID).DeptType1 == "物资" ? "物资出库单" : "药品出库单";
                    report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName + billType;
                    report.ParameterByName("Printer").AsString      = BaseData.GetUserName(Printer);
                    if (isShowTradePrice)
                    {
                        report.ParameterByName("TotalTradeFee").AsString = printMaster.TradeFee.ToString();
                        report.ParameterByName("TotalDiffFee").AsString  = (printMaster.RetailFee - printMaster.TradeFee).ToString();
                    }
                    else
                    {
                        report.ParameterByName("TotalTradeFee").AsString = "受管制无法显示";
                        report.ParameterByName("TotalDiffFee").AsString  = "受管制无法显示";
                    }
                    report.ParameterByName("Auditer").AsString     = BaseData.GetUserName(printMaster.AuditPeopleID);
                    report.ParameterByName("PrintTime").AsDateTime = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
                    //report.ParameterByName("BillDate").AsDateTime = (printMaster.BillDate);
                    report.PrintPreview(false);
                }
            }
        }
예제 #22
0
        void report_FetchRecord(ref bool pEof)
        {
            DataTable dt = (DataTable)dgvReport.DataSource;
            //整理成指定的列
            DataTable dtTitle    = HIS.MZ_BLL.ReportClass.GetReportTitle(FormTitle);
            DataTable dtRelation = HIS.MZ_BLL.ReportClass.GetReportTitleFieldRelation(FormTitle);

            DataTable dtPrint = new DataTable( );
            string    memo    = "";

            foreach (DataRow dr in dtTitle.Rows)
            {
                dtPrint.Columns.Add(dr["TITLE_NAME"].ToString( ).Trim( ));
            }
            try
            {
                bool first;
                first = true;
                foreach (DataRow dr in dt.Rows)
                {
                    DataRow drNew      = dtPrint.NewRow( );//构造新数据行
                    decimal totalValue = 0;
                    foreach (DataColumn col in dtPrint.Columns)
                    {
                        totalValue = 0;
                        DataRow[] drRelation = dtRelation.Select("TITLE_NAME = '" + col.ColumnName + "' ");
                        if (drRelation.Length == 1)
                        {
                            string field_name = drRelation[0]["FIELD_NAME"].ToString( ).Trim( );
                            drNew[col.ColumnName] = dr[field_name];
                        }
                        else
                        {
                            memo += col.ColumnName + "包括【";
                            for (int i = 0; i < drRelation.Length; i++)
                            {
                                decimal val        = 0;
                                string  field_name = drRelation[i]["FIELD_NAME"].ToString( ).Trim( );
                                if (!Convert.IsDBNull(dr[field_name]))
                                {
                                    val = Convert.ToDecimal(dr[field_name]);
                                }
                                totalValue += val;
                                memo       += field_name + ",";
                            }
                            memo += "】";
                            if (totalValue != 0)
                            {
                                drNew[col.ColumnName] = totalValue;
                            }
                        }
                    }
                    dtPrint.Rows.Add(drNew);

                    if (first)
                    {
                        reportPrinter.ParameterByName("备注").AsString = memo;
                        first = false;
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
            GWI_DesReport.HisReport.FillRecordToReport(reportPrinter, dtPrint);
        }
예제 #23
0
        /// <summary>
        /// 打印药库入库单汇总表
        /// </summary>
        /// <param name="path">路径</param>
        /// <param name="inMasterDt">入库单头表</param>
        /// <param name="billTime">单据时间</param>
        /// <param name="deptId">部门ID</param>
        /// <param name="printer">打印人员ID</param>
        static public void PringInStoreTotal(string path, DataTable inMasterDt, string billTime, int deptId, int printer)
        {
            try
            {
                decimal xy_RetailFee = 0, zcy_RetailFee = 0, zy_RetailFee = 0, xy_TradeFee = 0,
                        zcy_TradeFee = 0, zy_TradeFee = 0, wz_RetailFee = 0, wz_TradeFee = 0;

                decimal xy_RetailFee1 = 0, zcy_RetailFee1 = 0, zy_RetailFee1 = 0, xy_TradeFee1 = 0,
                        zcy_TradeFee1 = 0, zy_TradeFee1 = 0, wz_RetailFee1 = 0, wz_TradeFee1 = 0;

                int    supportId   = 0;
                string supportName = "";
                report = new grproLib.GridppReport();
                report.LoadFromFile(path);
                report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName
                                                                  + "入库单汇总";
                if (inMasterDt != null)
                {
                    if (inMasterDt.Rows.Count >= 1)
                    {
                        report.ParameterByName("BillTime").AsString = Convert.ToDateTime(inMasterDt.Rows[0]["AUDITTIME"]).ToString()
                                                                      + "到" + Convert.ToDateTime(inMasterDt.Rows[inMasterDt.Rows.Count - 1]["AUDITTIME"]).ToString();
                    }
                    else
                    {
                        report.ParameterByName("BillTime").AsString = billTime;
                    }
                    report.ParameterByName("BillCount").AsString = inMasterDt.Rows.Count.ToString();
                    for (int index = 0; index < inMasterDt.Rows.Count; index++)
                    {
                        DataRow currentRow = inMasterDt.Rows[index];
                        int     masterId   = Convert.ToInt32(currentRow["MASTERINSTORAGEID"]);
                        if (supportId != Convert.ToInt32(currentRow["SUPPORTDICID"]))
                        {
                            supportId = Convert.ToInt32(currentRow["SUPPORTDICID"]);
                            string currentSupporter = BindEntity <HIS.Model.YP_SupportDic> .CreateInstanceDAL(oleDb,
                                                                                                              BLL.Tables.YP_SUPPORTDIC).GetModel(supportId).Name;

                            if (supportName.IndexOf(currentSupporter + ",") == -1)
                            {
                                supportName += currentSupporter + ",";
                            }
                        }
                        //加载类型汇金额总表
                        DataTable typeFeeDt = BillQuery.LoadTotalFeeByInOrder(masterId);

                        DataTable outFeeDt = BillQuery.LoadTotalFeeByOutOrder(masterId);
                        //按类型累加各单据批发金额和零售金额(入库)
                        for (int temp = 0; temp < typeFeeDt.Rows.Count; temp++)
                        {
                            DataRow typeFeeRow = typeFeeDt.Rows[temp];
                            if (typeFeeRow["TypeDicID"] != DBNull.Value)
                            {
                                int typeId = Convert.ToInt32(typeFeeRow["TypeDicID"]);
                                switch (typeId)
                                {
                                case 1:
                                    xy_RetailFee += Convert.ToDecimal(typeFeeRow["RetailFee"]);
                                    xy_TradeFee  += Convert.ToDecimal(typeFeeRow["TradeFee"]);
                                    break;

                                case 2:
                                    zcy_RetailFee += Convert.ToDecimal(typeFeeRow["RetailFee"]);
                                    zcy_TradeFee  += Convert.ToDecimal(typeFeeRow["TradeFee"]);
                                    break;

                                case 3:
                                    zy_RetailFee += Convert.ToDecimal(typeFeeRow["RetailFee"]);
                                    zy_TradeFee  += Convert.ToDecimal(typeFeeRow["TradeFee"]);
                                    break;

                                case 4:
                                    wz_RetailFee += Convert.ToDecimal(typeFeeRow["RetailFee"]);
                                    wz_TradeFee  += Convert.ToDecimal(typeFeeRow["TradeFee"]);
                                    break;

                                default:
                                    break;
                                }
                            }
                        }

                        //按类型累加各单据批发金额和零售金额(退库) //update by heyan 增加退库汇总信息
                        for (int temp = 0; temp < outFeeDt.Rows.Count; temp++)
                        {
                            DataRow typeFeeRow = outFeeDt.Rows[temp];
                            if (typeFeeRow["TypeDicID"] != DBNull.Value)
                            {
                                int typeId = Convert.ToInt32(typeFeeRow["TypeDicID"]);
                                switch (typeId)
                                {
                                case 1:
                                    xy_RetailFee1 += Convert.ToDecimal(typeFeeRow["RetailFee"]);
                                    xy_TradeFee1  += Convert.ToDecimal(typeFeeRow["TradeFee"]);
                                    break;

                                case 2:
                                    zcy_RetailFee1 += Convert.ToDecimal(typeFeeRow["RetailFee"]);
                                    zcy_TradeFee1  += Convert.ToDecimal(typeFeeRow["TradeFee"]);
                                    break;

                                case 3:
                                    zy_RetailFee1 += Convert.ToDecimal(typeFeeRow["RetailFee"]);
                                    zy_TradeFee1  += Convert.ToDecimal(typeFeeRow["TradeFee"]);
                                    break;

                                case 4:
                                    wz_RetailFee1 += Convert.ToDecimal(typeFeeRow["RetailFee"]);
                                    wz_TradeFee1  += Convert.ToDecimal(typeFeeRow["TradeFee"]);
                                    break;

                                default:
                                    break;
                                }
                            }
                        }
                    }
                    //报表参数赋值
                    report.ParameterByName("SupportName").AsString = supportName;
                    report.ParameterByName("TradeFee").AsString    = (xy_TradeFee + zcy_TradeFee +
                                                                      zy_TradeFee + wz_TradeFee).ToString("0.00");
                    report.ParameterByName("DiffFee").AsString = (xy_RetailFee + zcy_RetailFee + zy_RetailFee + wz_RetailFee
                                                                  - xy_TradeFee - zcy_TradeFee - zy_TradeFee - wz_TradeFee).ToString("0.00");
                    report.ParameterByName("RetailFee").AsString = (xy_RetailFee + zcy_RetailFee +
                                                                    zy_RetailFee + wz_RetailFee).ToString("0.00");
                    report.ParameterByName("RetailFee_XY").AsString  = xy_RetailFee.ToString("0.00");
                    report.ParameterByName("RetailFee_ZCY").AsString = zcy_RetailFee.ToString("0.00");
                    report.ParameterByName("RetailFee_ZY").AsString  = zy_RetailFee.ToString("0.00");
                    report.ParameterByName("RetailFee_WZ").AsString  = wz_RetailFee.ToString("0.00");
                    report.ParameterByName("TradeFee_XY").AsString   = xy_TradeFee.ToString("0.00");
                    report.ParameterByName("TradeFee_ZCY").AsString  = zcy_TradeFee.ToString("0.00");
                    report.ParameterByName("TradeFee_ZY").AsString   = zy_TradeFee.ToString("0.00");
                    report.ParameterByName("TradeFee_WZ").AsString   = wz_TradeFee.ToString("0.00");
                    report.ParameterByName("DiffFee_XY").AsString    = (xy_RetailFee - xy_TradeFee).ToString("0.00");
                    report.ParameterByName("DiffFee_ZCY").AsString   = (zcy_RetailFee - zcy_TradeFee).ToString("0.00");
                    report.ParameterByName("DiffFee_ZY").AsString    = (zy_RetailFee - zy_TradeFee).ToString("0.00");
                    report.ParameterByName("DiffFee_WZ").AsString    = (wz_RetailFee - wz_TradeFee).ToString("0.00");
                    report.ParameterByName("DeptName").AsString      = BaseData.GetDeptName(deptId.ToString());
                    report.ParameterByName("Printer").AsString       = BaseData.GetUserName(printer);
                    report.ParameterByName("PrintTime").AsDateTime   = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;


                    report.ParameterByName("TradeFee1").AsString = (xy_TradeFee1 + zcy_TradeFee1 +
                                                                    zy_TradeFee1 + wz_TradeFee1).ToString("0.00");
                    report.ParameterByName("DiffFee1").AsString = (xy_RetailFee1 + zcy_RetailFee1 + zy_RetailFee1 + wz_RetailFee1
                                                                   - xy_TradeFee1 - zcy_TradeFee1 - zy_TradeFee1 - wz_TradeFee1).ToString("0.00");
                    report.ParameterByName("RetailFee1").AsString = (xy_RetailFee1 + zcy_RetailFee1 +
                                                                     zy_RetailFee1 + wz_RetailFee1).ToString("0.00");
                    report.ParameterByName("RetailFee_XY1").AsString  = xy_RetailFee1.ToString("0.00");
                    report.ParameterByName("RetailFee_ZCY1").AsString = zcy_RetailFee1.ToString("0.00");
                    report.ParameterByName("RetailFee_ZY1").AsString  = zy_RetailFee1.ToString("0.00");
                    report.ParameterByName("RetailFee_WZ1").AsString  = wz_RetailFee1.ToString("0.00");
                    report.ParameterByName("TradeFee_XY1").AsString   = xy_TradeFee1.ToString("0.00");
                    report.ParameterByName("TradeFee_ZCY1").AsString  = zcy_TradeFee1.ToString("0.00");
                    report.ParameterByName("TradeFee_ZY1").AsString   = zy_TradeFee1.ToString("0.00");
                    report.ParameterByName("TradeFee_WZ1").AsString   = wz_TradeFee1.ToString("0.00");
                    report.ParameterByName("DiffFee_XY1").AsString    = (xy_RetailFee1 - xy_TradeFee1).ToString("0.00");
                    report.ParameterByName("DiffFee_ZCY1").AsString   = (zcy_RetailFee1 - zcy_TradeFee1).ToString("0.00");
                    report.ParameterByName("DiffFee_ZY1").AsString    = (zy_RetailFee1 - zy_TradeFee1).ToString("0.00");
                    report.ParameterByName("DiffFee_WZ1").AsString    = (wz_RetailFee1 - wz_TradeFee1).ToString("0.00");


                    report.PrintPreview(false);
                }
            }
            catch (Exception error)
            {
                throw error;
            }
        }
예제 #24
0
 public override void Print(string path, HIS.Model.ZY_PatList patlist, List <HIS.Model.ZY_DOC_ORDERRECORD> applys, DateTime dtime, string name, string state)
 {
     if (path != "" && applys.Count > 0)
     {
         for (int i = 0; i < applys.Count; i++)
         {
             report = new grproLib.GridppReport();
             report.LoadFromFile(path);
             report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
             report.ParameterByName("医院名称").AsString    = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
             report.ParameterByName("cureno").AsString  = patlist.CureNo;
             report.ParameterByName("patname").AsString = patlist.PatientInfo.PatName;
             report.ParameterByName("patsex").AsString  = patlist.PatientInfo.PatSex;
             report.ParameterByName("bedcode").AsString = patlist.BedCode;
             string[] strdiag = patlist.DiseaseName.Split(new char[] { '|' });
             if (strdiag[0] == "")
             {
                 report.ParameterByName("diag").AsString = strdiag[1].Replace("\r\n", "");
             }
             else
             {
                 report.ParameterByName("diag").AsString = strdiag[0].Replace("\r\n", "");
             }
             report.ParameterByName("applydate").AsString  = dtime.ToString();
             report.ParameterByName("state").AsString      = state;
             report.ParameterByName("items").AsString      = applys[i].ORDER_CONTENT;
             report.ParameterByName("price").AsString      = applys[i].ORDER_PRICE.ToString() + " 元";
             report.ParameterByName("nums").AsString       = applys[i].AMOUNT.ToString();
             report.ParameterByName("totalprice").AsString = (Convert.ToDecimal(applys[i].ORDER_PRICE.ToString()) * Convert.ToDecimal(applys[i].AMOUNT.ToString())).ToString() + "元";
             report.ParameterByName("presdoc").AsString    = name;
             string age = HIS.SYSTEM.PubicBaseClasses.Age.GetAgeString(patlist.PatientInfo.PatBriDate, XcDate.ServerDateTime, 1);
             report.ParameterByName("patage").AsString = age;
             report.PrintPreview(false);
         }
     }
 }
예제 #25
0
        /// <summary>
        /// 打印住院摆药单据
        /// </summary>
        /// <param name="billMaster">单据表头</param>
        /// <param name="billOrder">单据明细</param>
        /// <param name="path">报表文件路径</param>
        /// <param name="Printer">打印人员</param>
        public override void PrintBill(HIS.Model.BillMaster billMaster, System.Data.DataTable billOrder, string path, int Printer)
        {
            //if (billMaster == null)
            //{
            //    return;
            //}
            //HIS.Model.YP_DRMaster printMaster = (HIS.Model.YP_DRMaster)billMaster;
            //billOrder = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE).LoadOrder(billMaster);
            //HIS.Interface.IZY_Data zyInterFace = new HIS.Interface.ZY_Data();
            //billOrder=zyInterFace
            //if (billOrder.Rows.Count > 0)
            //{
            //    _printOrder = billOrder;
            //    report = new grproLib.GridppReport();
            //    report.LoadFromFile(path);
            //    report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
            //    report.ParameterByName("CureNo").AsString = printMaster.InpatientID.ToString();
            //    report.ParameterByName("UserName").AsString = BaseData.GetUserName(printMaster.OPPeopleID);
            //    report.ParameterByName("ExeTime").AsDateTime = printMaster.OPTime;
            //    report.ParameterByName("PatientName").AsString = printMaster.PatientName;
            //    report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
            //    report.ParameterByName("PrintTime").AsDateTime = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
            //    report.ParameterByName("Printer").AsString = BaseData.GetUserName(Printer);
            //    report.PrintPreview(false);
            //}
            if (billMaster == null)
            {
                if (billOrder == null)
                {
                    return;
                }
                if (billOrder.Rows.Count > 0)
                {
                    HIS.Model.ZY_PatList patlist = HIS.SYSTEM.Core.BindEntity <HIS.Model.ZY_PatList> .CreateInstanceDAL(oleDb).GetModel(Convert.ToInt32(billOrder.Rows[0]["patlistid"]));

                    _printOrder = billOrder;
                    //for (int i = 0; i < _printOrder.Rows.Count; i++)
                    //{
                    //    decimal presamount =( _printOrder.Rows[i]["presamount"] == null || _printOrder.Rows[i]["presamount"].ToString() == "0" ? 1 : Convert.ToDecimal(_printOrder.Rows[i]["presamount"].ToString()));
                    //    _printOrder.Rows[i]["amount"] = Convert.ToDecimal(_printOrder.Rows[i]["amount"].ToString()) / presamount;
                    //}
                    report = new grproLib.GridppReport();
                    report.LoadFromFile(path);
                    report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                    report.ParameterByName("CureNo").AsString   = patlist.CureNo;
                    report.ParameterByName("UserName").AsString = BaseData.GetUserName(Printer);
                    //report.ParameterByName("ExeTime").AsDateTime = printMaster.OPTime;
                    report.ParameterByName("PatientName").AsString  = patlist.PatientInfo.PatName;
                    report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
                    report.ParameterByName("PrintTime").AsDateTime  = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
                    report.ParameterByName("Printer").AsString      = BaseData.GetUserName(Printer);
                    report.ParameterByName("总金额").AsString          = Convert.ToDecimal(_printOrder.Compute("sum(tolal_fee)", "")).ToString("0.00") + " 元";
                    report.ParameterByName("病人科室").AsString         = BaseData.GetDeptName(patlist.CurrDeptCode);
                    report.ParameterByName("开方医生").AsString         = billOrder.Rows[0]["presdocname"].ToString();
                    report.PrintPreview(false);
                }
            }
            else
            {
                HIS.Model.YP_DRMaster printMaster = (HIS.Model.YP_DRMaster)billMaster;
                billOrder = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE).LoadOrder(billMaster);
                if (billOrder.Rows.Count > 0)
                {
                    _printOrder = billOrder;
                    for (int i = 0; i < _printOrder.Rows.Count; i++)
                    {
                        decimal presamount = (_printOrder.Rows[i]["recipenum"] == null || _printOrder.Rows[i]["recipenum"].ToString() == "0" ? 1 : Convert.ToDecimal(_printOrder.Rows[i]["recipenum"].ToString()));
                        _printOrder.Rows[i]["drugocnum"] = Convert.ToDecimal(_printOrder.Rows[i]["drugocnum"].ToString()) / presamount;
                    }
                    report = new grproLib.GridppReport();
                    report.LoadFromFile(path);
                    report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                    report.ParameterByName("CureNo").AsString       = printMaster.InpatientID.ToString();
                    report.ParameterByName("UserName").AsString     = BaseData.GetUserName(printMaster.OPPeopleID);
                    report.ParameterByName("ExeTime").AsDateTime    = printMaster.OPTime;
                    report.ParameterByName("PatientName").AsString  = printMaster.PatientName;
                    report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
                    report.ParameterByName("PrintTime").AsDateTime  = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
                    report.ParameterByName("Printer").AsString      = BaseData.GetUserName(Printer);
                    report.ParameterByName("总金额").AsString          = Convert.ToDecimal(_printOrder.Compute("sum(retailfee)", "")).ToString("0.00") + " 元";

                    report.PrintPreview(false);
                }
            }
        }
예제 #26
0
        /// <summary>
        /// 打印盘点汇总单据
        /// </summary>
        /// <param name="billMaster">单据表头</param>
        /// <param name="billOrder">单据明细</param>
        /// <param name="path">报表文件路径</param>
        /// <param name="Printer">打印人员</param>
        public override void PrintBill(HIS.Model.BillMaster billMaster, System.Data.DataTable billOrder, string path, int Printer)
        {
            try
            {
                if (billMaster == null)
                {
                    return;
                }
                HIS.Model.YP_CheckMaster printMaster = (HIS.Model.YP_CheckMaster)billMaster;
                string strWhere = BLL.Tables.yk_checkmaster.AUDITNUM + oleDb.EuqalTo() + printMaster.AuditNum + oleDb.And()
                                  + BLL.Tables.yk_checkmaster.DEL_FLAG + oleDb.EuqalTo() + "0" + oleDb.And()
                                  + BLL.Tables.yk_checkmaster.DEPTID + oleDb.EuqalTo() + printMaster.DeptID;
                List <YP_CheckMaster> masterList = new List <YP_CheckMaster>();
                DataTable             orderDt    = null;
                #region 合并药房盘点单
                if (printMaster.OpType == ConfigManager.OP_YF_CHECK)
                {
                    masterList = BindEntity <YP_CheckMaster> .CreateInstanceDAL(oleDb, BLL.Tables.YF_CHECKMASTER).GetListArray(strWhere);

                    if (masterList.Count <= 0)
                    {
                        return;
                    }
                    foreach (YP_CheckMaster master in masterList)
                    {
                        if (orderDt == null)
                        {
                            orderDt            = BillFactory.GetQuery(ConfigManager.OP_YF_CHECK).LoadOrder(master);
                            orderDt.PrimaryKey = new DataColumn[] { orderDt.Columns["MAKERDICID"] };
                            continue;
                        }
                        else
                        {
                            DataTable newDt = BillFactory.GetQuery(ConfigManager.OP_YF_CHECK).LoadOrder(master);
                            for (int index = 0; index < newDt.Rows.Count; index++)
                            {
                                DataRow currentRow = newDt.Rows[index];
                                DataRow findRow    = orderDt.Rows.Find(Convert.ToInt32(currentRow["MAKERDICID"]));
                                if (findRow == null)
                                {
                                    orderDt.Rows.Add(currentRow.ItemArray);
                                }
                                else
                                {
                                    findRow["CPACKNUM"] = Convert.ToDecimal(findRow["CPACKNUM"])
                                                          + Convert.ToDecimal(currentRow["CPACKNUM"]);
                                    findRow["CKRETAILFEE"] = Convert.ToDecimal(findRow["CKRETAILFEE"])
                                                             + Convert.ToDecimal(currentRow["CKRETAILFEE"]);
                                    findRow["CKTRADEFEE"] = Convert.ToDecimal(findRow["CKTRADEFEE"])
                                                            + Convert.ToDecimal(currentRow["CKTRADEFEE"]);
                                    findRow["CBASENUM"] = Convert.ToDecimal(findRow["CBASENUM"])
                                                          + Convert.ToDecimal(currentRow["CBASENUM"]);
                                }
                            }
                        }
                    }
                }
                #endregion
                #region 合并药库盘点单
                if (printMaster.OpType == ConfigManager.OP_YK_CHECK)
                {
                    masterList = BindEntity <YP_CheckMaster> .CreateInstanceDAL(oleDb, BLL.Tables.YK_CHECKMASTER).GetListArray(strWhere);

                    if (masterList.Count <= 0)
                    {
                        return;
                    }
                    foreach (YP_CheckMaster master in masterList)
                    {
                        if (orderDt == null)
                        {
                            orderDt            = BillFactory.GetQuery(ConfigManager.OP_YK_CHECK).LoadOrder(master);
                            orderDt.PrimaryKey = new DataColumn[] { orderDt.Columns["MAKERDICID"], orderDt.Columns["BATCHNUM"] };
                            continue;
                        }
                        else
                        {
                            DataTable newDt = BillFactory.GetQuery(ConfigManager.OP_YK_CHECK).LoadOrder(master);
                            for (int index = 0; index < newDt.Rows.Count; index++)
                            {
                                DataRow currentRow = newDt.Rows[index];
                                DataRow findRow    = orderDt.Rows.Find(new object[] { Convert.ToInt32(currentRow["MAKERDICID"]),
                                                                                      currentRow["BATCHNUM"].ToString() });
                                if (findRow == null)
                                {
                                    orderDt.Rows.Add(currentRow.ItemArray);
                                }
                                else
                                {
                                    findRow["CPACKNUM"] = Convert.ToDecimal(findRow["CPACKNUM"])
                                                          + Convert.ToDecimal(currentRow["CPACKNUM"]);
                                    findRow["CKRETAILFEE"] = Convert.ToDecimal(findRow["CKRETAILFEE"])
                                                             + Convert.ToDecimal(currentRow["CKRETAILFEE"]);
                                    findRow["CKTRADEFEE"] = Convert.ToDecimal(findRow["CKTRADEFEE"])
                                                            + Convert.ToDecimal(currentRow["CKTRADEFEE"]);
                                }
                            }
                        }
                    }
                }
                #endregion
                #region 生成盘点单汇总数据
                billOrder = orderDt.Clone();
                DataRow[] dRows = orderDt.Select("", "typename,chemname asc");
                foreach (DataRow dRow in dRows)
                {
                    billOrder.Rows.Add(dRow.ItemArray);
                }
                billOrder.Columns.Add("DIFFFEE", System.Type.GetType("System.Decimal"));
                billOrder.Columns.Add("DIFFTRADEFEE", System.Type.GetType("System.Decimal"));
                for (int index = 0; index < billOrder.Rows.Count; index++)
                {
                    decimal diffRetailFee = Convert.ToDecimal(billOrder.Rows[index]["CKRETAILFEE"]) -
                                            Convert.ToDecimal(billOrder.Rows[index]["FTRETAILFEE"]);
                    decimal diffTradeFee = Convert.ToDecimal(billOrder.Rows[index]["CKTRADEFEE"]) -
                                           Convert.ToDecimal(billOrder.Rows[index]["FTTRADEFEE"]);
                    billOrder.Rows[index]["DIFFFEE"]      = diffRetailFee;
                    billOrder.Rows[index]["DIFFTRADEFEE"] = diffTradeFee;
                    //盘盈
                    if (diffRetailFee > 0)
                    {
                        printMaster.MoreRetailFee += diffRetailFee;
                        printMaster.MoreTradeFee  += diffTradeFee;
                    }
                    //盘亏
                    else
                    {
                        printMaster.LessRetailFee -= diffRetailFee;
                        printMaster.LessTradeFee  -= diffTradeFee;
                    }
                }
                printMaster.AuditNum      = masterList[0].AuditNum;
                printMaster.AuditPeopleID = masterList[0].AuditPeopleID;
                printMaster.AuditTime     = masterList[0].AuditTime;
                printMaster.DeptID        = masterList[0].DeptID;
                #endregion
                #region 参数赋值
                if (billOrder.Rows.Count > 0)
                {
                    _printOrder = billOrder;
                    report      = new grproLib.GridppReport();
                    report.LoadFromFile(path);
                    report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                    report.ParameterByName("CheckDate").AsDateTime      = printMaster.AuditTime;
                    report.ParameterByName("BillNo").AsString           = printMaster.AuditNum.ToString();
                    report.ParameterByName("HospitalName").AsString     = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
                    report.ParameterByName("Printer").AsString          = BaseData.GetUserName(Printer);
                    report.ParameterByName("PrintTime").AsDateTime      = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
                    report.ParameterByName("AuditPeople").AsString      = BaseData.GetUserName(printMaster.AuditPeopleID);
                    report.ParameterByName("AuditDept").AsString        = BaseData.GetDeptName(printMaster.DeptID.ToString()) + "盘点单据";
                    report.ParameterByName("FtTradeFee").AsString       = billOrder.Compute("sum(CKTRADEFEE)", "").ToString();
                    report.ParameterByName("FtRetailFee").AsString      = billOrder.Compute("sum(CKRETAILFEE)", "").ToString();
                    report.ParameterByName("XYFtTradeFee").AsString     = billOrder.Compute("sum(CKTRADEFEE)", "typedicid=1").ToString();
                    report.ParameterByName("XYFtRetailFee").AsString    = billOrder.Compute("sum(CKRETAILFEE)", "typedicid=1").ToString();
                    report.ParameterByName("ZCYFtTradeFee").AsString    = billOrder.Compute("sum(CKTRADEFEE)", "typedicid=2").ToString();
                    report.ParameterByName("ZCYFtRetailFee").AsString   = billOrder.Compute("sum(CKRETAILFEE)", "typedicid=2").ToString();
                    report.ParameterByName("ZYFtTradeFee").AsString     = billOrder.Compute("sum(CKTRADEFEE)", "typedicid=3").ToString();
                    report.ParameterByName("ZYFtRetailFee").AsString    = billOrder.Compute("sum(CKRETAILFEE)", "typedicid=3").ToString();
                    report.ParameterByName("WZFtTradeFee").AsString     = billOrder.Compute("sum(CKTRADEFEE)", "typedicid=4").ToString();
                    report.ParameterByName("WZFtRetailFee").AsString    = billOrder.Compute("sum(CKRETAILFEE)", "typedicid=4").ToString();
                    report.ParameterByName("CkTradeFee").AsString       = billOrder.Compute("sum(FTTRADEFEE)", "").ToString();
                    report.ParameterByName("CkRetailFee").AsString      = billOrder.Compute("sum(FTRETAILFEE)", "").ToString();
                    report.ParameterByName("XYCkTradeFee").AsString     = billOrder.Compute("sum(FTTRADEFEE)", "typedicid=1").ToString();
                    report.ParameterByName("XYCkRetailFee").AsString    = billOrder.Compute("sum(FTRETAILFEE)", "typedicid=1").ToString();
                    report.ParameterByName("ZCYCkTradeFee").AsString    = billOrder.Compute("sum(FTTRADEFEE)", "typedicid=2").ToString();
                    report.ParameterByName("ZCYCkRetailFee").AsString   = billOrder.Compute("sum(FTRETAILFEE)", "typedicid=2").ToString();
                    report.ParameterByName("ZYCkTradeFee").AsString     = billOrder.Compute("sum(FTTRADEFEE)", "typedicid=3").ToString();
                    report.ParameterByName("ZYCkRetailFee").AsString    = billOrder.Compute("sum(FTRETAILFEE)", "typedicid=3").ToString();
                    report.ParameterByName("WZCkTradeFee").AsString     = billOrder.Compute("sum(FTTRADEFEE)", "typedicid=4").ToString();
                    report.ParameterByName("WZCkRetailFee").AsString    = billOrder.Compute("sum(FTRETAILFEE)", "typedicid=4").ToString();
                    report.ParameterByName("MoreRetailFee").AsString    = printMaster.MoreRetailFee.ToString();
                    report.ParameterByName("MoreTradeFee").AsString     = printMaster.MoreTradeFee.ToString();
                    report.ParameterByName("XYMoreRetailFee").AsString  = billOrder.Compute("sum(DIFFFEE)", "typedicid=1 and difffee>0").ToString();
                    report.ParameterByName("XYMoreTradeFee").AsString   = billOrder.Compute("sum(DIFFTRADEFEE)", "typedicid=1 and difftradefee>0").ToString();
                    report.ParameterByName("ZCYMoreRetailFee").AsString = billOrder.Compute("sum(DIFFFEE)", "typedicid=2 and difffee>0").ToString();
                    report.ParameterByName("ZCYMoreTradeFee").AsString  = billOrder.Compute("sum(DIFFTRADEFEE)", "typedicid=2 and difftradefee>0").ToString();
                    report.ParameterByName("ZYMoreRetailFee").AsString  = billOrder.Compute("sum(DIFFFEE)", "typedicid=3 and difffee>0").ToString();
                    report.ParameterByName("ZYMoreTradeFee").AsString   = billOrder.Compute("sum(DIFFTRADEFEE)", "typedicid=3 and difftradefee>0").ToString();
                    report.ParameterByName("WZMoreRetailFee").AsString  = billOrder.Compute("sum(DIFFFEE)", "typedicid=4 and difffee>0").ToString();
                    report.ParameterByName("WZMoreTradeFee").AsString   = billOrder.Compute("sum(DIFFTRADEFEE)", "typedicid=4 and difftradefee>0").ToString();
                    report.ParameterByName("LessRetailFee").AsString    = (-printMaster.LessRetailFee).ToString();
                    report.ParameterByName("LessTradeFee").AsString     = (-printMaster.LessTradeFee).ToString();
                    report.ParameterByName("XYLessRetailFee").AsString  = billOrder.Compute("sum(DIFFFEE)", "typedicid=1 and difffee<0").ToString();
                    report.ParameterByName("XYLessTradeFee").AsString   = billOrder.Compute("sum(DIFFTRADEFEE)", "typedicid=1 and difftradefee<0").ToString();
                    report.ParameterByName("ZCYLessRetailFee").AsString = billOrder.Compute("sum(DIFFFEE)", "typedicid=2 and difffee<0").ToString();
                    report.ParameterByName("ZCYLessTradeFee").AsString  = billOrder.Compute("sum(DIFFTRADEFEE)", "typedicid=2 and difftradefee<0").ToString();
                    report.ParameterByName("ZYLessRetailFee").AsString  = billOrder.Compute("sum(DIFFFEE)", "typedicid=3 and difffee<0").ToString();
                    report.ParameterByName("ZYLessTradeFee").AsString   = billOrder.Compute("sum(DIFFTRADEFEE)", "typedicid=3 and difftradefee<0").ToString();
                    report.ParameterByName("WZLessRetailFee").AsString  = billOrder.Compute("sum(DIFFFEE)", "typedicid=4 and difffee<0").ToString();
                    report.ParameterByName("WZLessTradeFee").AsString   = billOrder.Compute("sum(DIFFTRADEFEE)", "typedicid=4 and difftradefee<0").ToString();
                    report.PrintPreview(false);
                }
                #endregion
            }
            catch (Exception error)
            {
                throw error;
            }
        }
예제 #27
0
        /// <summary>
        /// 打印入库单据
        /// </summary>
        /// <param name="billMaster">单据表头</param>
        /// <param name="billOrder">单据明细</param>
        /// <param name="path">报表文件路径</param>
        /// <param name="Printer">打印人员</param>
        public override void PrintBill(HIS.Model.BillMaster billMaster, System.Data.DataTable billOrder, string path, int Printer)
        {
            try
            {
                string billType = "";
                HIS.Model.YP_InMaster printMaster = (HIS.Model.YP_InMaster)billMaster;
                DataTable             dtt         = billOrder.Clone();
                DataRow[]             datarows;
                datarows = billOrder.Select("");
                foreach (DataRow dr in datarows)
                {
                    dtt.Rows.Add(dr.ItemArray);
                }
                DataColumn dc = null;
                dc = dtt.Columns.Add("OVERNUM", Type.GetType("System.String")); //  增加结余数 zhangyunhui 5.8
                for (int i = 0; i < dtt.Rows.Count; i++)
                {
                    dtt.Rows[i]["OVERNUM"] = Getovernumber(Convert.ToInt32(dtt.Rows[i]["INSTORAGEID"].ToString()));
                }
                _printOrder = dtt;

                if (printMaster != null && billOrder.Rows.Count > 0)
                {
                    report = new grproLib.GridppReport();
                    report.LoadFromFile(path);
                    report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                    report.ParameterByName("Supporter").AsString = printMaster.SupportDic.Name;
                    report.ParameterByName("InvoiceNo").AsString = printMaster.InvoiceNum;
                    report.ParameterByName("BillNo").AsString    = printMaster.BillNum.ToString();
                    if (printMaster.Audit_Flag == 0)
                    {
                        report.ParameterByName("ExeTime").AsString     = printMaster.RegTime.ToString();
                        report.ParameterByName("AuditPeople").AsString = BaseData.GetUserName(printMaster.RegPeopleID);
                    }
                    else
                    {
                        report.ParameterByName("ExeTime").AsString     = printMaster.AuditTime.ToString();
                        report.ParameterByName("AuditPeople").AsString = BaseData.GetUserName(printMaster.AuditPeopleID);
                    }
                    report.ParameterByName("TotalFee").AsString    = printMaster.RetailFee.ToString();
                    report.ParameterByName("CurrentUser").AsString = BaseData.GetUserName(printMaster.RegPeopleID);
                    if (printMaster.OpType == ConfigManager.OP_YK_BACKSTORE)
                    {
                        billType = DrugBaseDataBll.FindDrugDept(printMaster.DeptID).DeptType1 == "物资" ? "物资退库单" : "药品退库单";
                    }
                    else
                    {
                        billType = DrugBaseDataBll.FindDrugDept(printMaster.DeptID).DeptType1 == "物资" ? "物资入库单" : "药品入库单";
                    }
                    report.ParameterByName("CurrentDept").AsString  = BaseData.GetDeptName(printMaster.DeptID.ToString());
                    report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName + billType;
                    report.ParameterByName("Printer").AsString      = BaseData.GetUserName(Printer);
                    report.ParameterByName("PrintTime").AsDateTime  = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
                    report.ParameterByName("InstoreFee").AsString   = printMaster.StockFee.ToString();
                    report.ParameterByName("DiffFee").AsString      = (printMaster.RetailFee - printMaster.StockFee).ToString();
                    report.ParameterByName("ReMark").AsString       = printMaster.ReMark.ToString();
                    report.PrintPreview(false);
                }
            }
            catch (Exception error)
            {
                throw error;
            }
        }
예제 #28
0
        /// <summary>
        /// 打印库存清单
        /// </summary>
        /// <param name="path">报表位置</param>
        /// <param name="printer">打印人</param>
        /// <param name="deptId">部门ID</param>
        /// <param name="drugInfo">药品库存信息表</param>
        /// <param name="_belongSystem">所属系统(药房、药库)</param>
        static public void PrintStoreBill(string path, int printer, int deptId, DataTable drugInfo, string _belongSystem)
        {
            _printOrder = drugInfo.Copy();
            if (path != "" && drugInfo.Rows.Count > 0)
            {
                decimal retailFee     = StoreFactory.GetQuery(_belongSystem).QueryStoreFee(deptId, 0);
                decimal tradeFee      = StoreFactory.GetQuery(_belongSystem).QueryTradeFee(deptId, 0);
                decimal xy_RetailFee  = StoreFactory.GetQuery(_belongSystem).QueryStoreFee(deptId, 1);
                decimal zcy_RetailFee = StoreFactory.GetQuery(_belongSystem).QueryStoreFee(deptId, 2);
                decimal zy_RetailFee  = StoreFactory.GetQuery(_belongSystem).QueryStoreFee(deptId, 3);
                decimal xy_TradeFee   = StoreFactory.GetQuery(_belongSystem).QueryTradeFee(deptId, 1);
                decimal zcy_TradeFee  = StoreFactory.GetQuery(_belongSystem).QueryTradeFee(deptId, 2);
                decimal zy_TradeFee   = StoreFactory.GetQuery(_belongSystem).QueryTradeFee(deptId, 3);
                report = new grproLib.GridppReport();
                report.LoadFromFile(path);
                report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord);
                report.ParameterByName("Printer").AsString      = BaseData.GetUserName(printer);
                report.ParameterByName("DeptName").AsString     = BaseData.GetDeptName(deptId.ToString());
                report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName;
                report.ParameterByName("PrintTime").AsDateTime  = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
                report.ParameterByName("TotalFee").AsString     = retailFee.ToString("0.00");

                report.ParameterByName("TotalFee_XY").AsString  = xy_RetailFee.ToString("0.00");
                report.ParameterByName("TotalFee_ZCY").AsString = zcy_RetailFee.ToString("0.00");
                report.ParameterByName("TotalFee_ZY").AsString  = zy_RetailFee.ToString("0.00");
                if (_belongSystem == ConfigManager.YF_SYSTEM && !ConfigManager.ManageTradepriceByYF())
                {
                    report.ParameterByName("TradeFee").AsString     = "受管制无法显示";
                    report.ParameterByName("DiffFee").AsString      = "受管制无法显示";
                    report.ParameterByName("TradeFee_XY").AsString  = "受管制无法显示";
                    report.ParameterByName("TradeFee_ZCY").AsString = "受管制无法显示";
                    report.ParameterByName("TradeFee_ZY").AsString  = "受管制无法显示";
                    report.ParameterByName("DiffFee_XY").AsString   = "受管制无法显示";
                    report.ParameterByName("DiffFee_ZCY").AsString  = "受管制无法显示";
                    report.ParameterByName("DiffFee_ZY").AsString   = "受管制无法显示";
                    _printOrder.Columns.Remove("TRADEPRICE");
                    _printOrder.Columns.Remove("TRADEFEE");
                    _printOrder.Columns.Remove("FEEDIFFERENCE");
                    report.PrintPreview(false);
                    return;
                }
                else
                {
                    report.ParameterByName("TradeFee").AsString     = tradeFee.ToString("0.00");
                    report.ParameterByName("DiffFee").AsString      = (retailFee - tradeFee).ToString("0.00");
                    report.ParameterByName("TradeFee_XY").AsString  = xy_TradeFee.ToString("0.00");
                    report.ParameterByName("TradeFee_ZCY").AsString = zcy_TradeFee.ToString("0.00");
                    report.ParameterByName("TradeFee_ZY").AsString  = zy_TradeFee.ToString("0.00");
                    report.ParameterByName("DiffFee_XY").AsString   = (xy_RetailFee - xy_TradeFee).ToString("0.00");
                    report.ParameterByName("DiffFee_ZCY").AsString  = (zcy_RetailFee - zcy_TradeFee).ToString("0.00");
                    report.ParameterByName("DiffFee_ZY").AsString   = (zy_RetailFee - zy_TradeFee).ToString("0.00");
                    report.PrintPreview(false);
                    return;
                }
            }
        }