Beispiel #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)
 {
     try
     {
         if (billMaster == null)
         {
             return;
         }
         HIS.Model.YP_DRMaster printMaster = (HIS.Model.YP_DRMaster)billMaster;
         billOrder = HIS.YP_BLL.BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE).LoadOrder(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("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.ToString());
             report.ParameterByName("DeptName").AsString     = BaseData.GetDeptName(printMaster.DeptID.ToString());
             report.ParameterByName("RecipeNum").AsString    = printMaster.RecipeNum.ToString();
             report.ParameterByName("RecipeNo").AsString     = printMaster.RecipeID.ToString();
             report.ParameterByName("Printer").AsString      = BaseData.GetUserName(Printer);
             report.ParameterByName("PrintTime").AsDateTime  = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
             report.PrintPreview(false);
         }
     }
     catch (Exception error)
     {
         throw error;
     }
 }
Beispiel #2
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("InpatientNo").AsString  = printMaster.InpatientID;
         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("Printer").AsString      = BaseData.GetUserName(Printer);
         report.ParameterByName("PrintTime").AsDateTime  = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
         report.PrintPreview(false);
     }
 }
Beispiel #3
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);
                }
            }
        }