/// <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; } } }
/// <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); } }
/// <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; } }
/// <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); } }
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); } }
/// <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); } }
/// <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; } }
/// <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; } }
public override void Print(ReportParameter[] parameters) { grdrpt.LoadFromFile(FullReportTemplateFileName); grdrpt.Printer.PrinterName = PrinterName; SetParameters(parameters); if (Preview) { grdrpt.PrintPreview(true); } else { grdrpt.Print(false); } }
//交款表打印 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); }
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; } }
/// <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; } }
//打印住院发票 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 }
public override void Print(string path, HIS.Model.ZY_PatList patlist, List <HIS.Model.ZY_DOC_ORDERRECORD> applys, DateTime dtime, string name, string state, string palce, string deptname, string tjjg, string Xjg, string hyjg, string othercheck) { 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 = 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; report.ParameterByName("床号").AsString = patlist.BedCode; 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 = name; report.ParameterByName("项目金额").AsString = price.ToString() + " 元"; report.ParameterByName("申请科室").AsString = deptname; report.ParameterByName("打印人").AsString = name; report.ParameterByName("Purpose").AsString = itemname; report.ParameterByName("History").AsString = state; report.ParameterByName("检查部位").AsString = palce; report.ParameterByName("体检").AsString = tjjg; report.ParameterByName("X线检查结果").AsString = Xjg; report.ParameterByName("化验结果").AsString = hyjg; report.ParameterByName("其他辅助检查").AsString = othercheck; report.PrintPreview(false); } }
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); } } }
//打印 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); } } }
/// <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; } }
/// <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); } }
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); } } }
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); } }
/// <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; } }
/// <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; } }
/// <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); } } }
/// <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); } } }
private void BtnNumber_Click(object sender, EventArgs e) { Button btn = (Button)sender; PassToStockEdit ors; switch (btn.Name) { case "Delete": try { SqlConnection conn = sqlcon.getcon(""); string strsql = "delete from BR_PassToStock where ID='" + WPHbROWDGV.Rows[WPHbROWDGV.CurrentCell.RowIndex].Cells["ID"].Value.ToString() + "'"; conn.Open(); SqlCommand sqlcom = new SqlCommand(strsql, conn); sqlcom.ExecuteNonQuery(); conn.Close(); sqlcom.Dispose(); MessageBox.Show("已删除!!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch { MessageBox.Show("删除失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } break; case "Edit": if (WPHbROWDGV.Rows.Count > 0) { ors = new PassToStockEdit(WPHbROWDGV.Rows[WPHbROWDGV.CurrentCell.RowIndex].Cells["ID"].Value.ToString(), "BR_PassToStock"); ors.ShowDialog(); } break; case "Excel": if (WPHbROWDGV.Rows.Count > 0) { //建立Excel对象 Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); excel.Application.Workbooks.Add(true); //生成字段名称 for (int i = 0; i < WPHbROWDGV.ColumnCount; i++) { excel.Cells[1, i + 1] = WPHbROWDGV.Columns[i].HeaderText; } //填充数据 for (int i = 0; i < WPHbROWDGV.RowCount; i++) { for (int j = 0; j < WPHbROWDGV.ColumnCount; j++) { if (WPHbROWDGV[j, i].Value == typeof(string)) { excel.Cells[i + 2, j + 1] = "" + WPHbROWDGV[i, j].Value.ToString(); } else { excel.Cells[i + 2, j + 1] = WPHbROWDGV[j, i].Value.ToString(); } } } excel.Visible = true; } else { MessageBox.Show("没有你要导的数据!!!"); } break; case "Pring": //数据参数新增 if (WPHbROWDGV.Rows.Count > 0) { grproLib.GridppReport Report = new grproLib.GridppReport(); DataTable dt = new DataTable(); SqlConnection conn = sqlcon.getcon(""); string strsql = " select BR_PassToStock.Cade,Cadedate,m_Factory.title files,Ordercade,BarCode,item_no as Item,S_COLOR as Color,CO_CODE as Code,m_product.photo," + "m_SizeDetails.cade as Sizecade,m_SizeDetails.[name] as Sizename,khdw,m_SizeDetails.Name as Size,Qty as Nomber,m_ProductSub.pid,username " + "from BR_PassToStock " + "left join m_Factory on m_Factory.id=BR_PassToStock.FID " + "left join m_product on m_product.id=BR_PassToStock.pid " + "left join m_ProductSub on m_ProductSub.id=BR_PassToStock.colourid " + "left join m_SizeDetails on m_SizeDetails.id=BR_PassToStock.sdid where BarCode='" + WPHbROWDGV[4, WPHbROWDGV.CurrentCell.RowIndex].Value.ToString() + "' and BR_PassToStock.Cade='" + WPHbROWDGV[0, WPHbROWDGV.CurrentCell.RowIndex].Value.ToString() + "'"; SqlDataAdapter sqlDaper = new SqlDataAdapter(strsql, conn); DataSet ds = new DataSet(); try { conn.Open(); sqlDaper.Fill(ds); conn.Close(); try { //下载打印图片 string strimageurl = "http://120.43.209.230:8082/" + ds.Tables[0].Rows[0]["photo"].ToString(); System.Net.WebClient webclient = new System.Net.WebClient(); webclient.DownloadFile(strimageurl, @"D:\迈途\ZXCPTP.jpg"); } catch (Exception ex) { if (File.Exists(@"D:\迈途\ZXCPTP.jpg")) //判断文件是不是存在 { File.Delete(@"D:\迈途\ZXCPTP.jpg"); //如果存在则删除 } Console.WriteLine(ex.Message); } Report.LoadFromFile(@rwos().ToString()); Report.ConnectionString = sqlcon.XMLIP(); Report.QuerySQL = " select BR_PassToStock.Cade,Cadedate,m_Factory.title files,Ordercade,BarCode,item_no as Item,S_COLOR as Color,CO_CODE as Code,m_product.photo," + "m_SizeDetails.cade as Sizecade,m_SizeDetails.[name] as Sizename,khdw,m_SizeDetails.Name as Size,Qty as Nomber,m_ProductSub.pid,username " + "from BR_PassToStock " + "left join m_Factory on m_Factory.id=BR_PassToStock.FID " + "left join m_product on m_product.id=BR_PassToStock.pid " + "left join m_ProductSub on m_ProductSub.id=BR_PassToStock.colourid " + "left join m_SizeDetails on m_SizeDetails.id=BR_PassToStock.sdid where BarCode='" + WPHbROWDGV[4, WPHbROWDGV.CurrentCell.RowIndex].Value.ToString() + "' and BR_PassToStock.Cade='" + WPHbROWDGV[0, WPHbROWDGV.CurrentCell.RowIndex].Value.ToString() + "'"; //Report.Print(false); DialogResult result = MessageBox.Show("“是”直接打印,“否”打印预览", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (result == DialogResult.Yes) { Report.Print(false); } else { Report.PrintPreview(true); } } catch (Exception ex) { Console.WriteLine(ex.Message); } } else { MessageBox.Show("没有你要打印的数据!!"); } break; } }
//打印主功能 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); } }
/// <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; } }
private void btnPackintBarCode_Click(object sender, EventArgs e) { try { grproLib.GridppReport Report = new grproLib.GridppReport(); DataSet ds = new DataSet(); SqlConnection conn = sqlcon.getcon(""); try { string sqlstr = ""; for (int i = 0; i < WPHbROWDGV.Rows.Count; i++) { if (WPHbROWDGV.Rows[i].Cells["Cade"].Value.ToString() != "合计") { sqlstr += " insert into Wph_PackingPrint(Cade,BarCode,Item,Size,Colour,Nomber,[ADd],Special) values ('" + WPHbROWDGV.Rows[i].Cells["Cade"].Value.ToString() + "','" + WPHbROWDGV.Rows[i].Cells["BarCode"].Value.ToString() + "','" + WPHbROWDGV.Rows[i].Cells["Item_no"].Value.ToString() + "','" + WPHbROWDGV.Rows[i].Cells["SDname"].Value.ToString() + "','" + WPHbROWDGV.Rows[i].Cells["s_color"].Value.ToString() + "','" + WPHbROWDGV.Rows[i].Cells["NO"].Value.ToString() + "','" + WPHbROWDGV.Rows[i].Cells["stname"].Value.ToString() + "','" + WPHbROWDGV.Rows[i].Cells["Special"].Value.ToString() + "');"; } } conn.Open(); SqlCommand cmd = new SqlCommand(sqlstr, conn); cmd.ExecuteNonQuery(); sqlstr = ""; SqlDataAdapter sqlDaper = new SqlDataAdapter("select cade,[add],Special,count(1) as counts from Wph_PackingPrint group by cade,[add],Special", conn); sqlDaper.Fill(ds); try { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { // % Convert.ToInt32(txtRows.Text.ToString()) for (int row = Convert.ToInt32(ds.Tables[0].Rows[i]["counts"].ToString()); row < 16; row++) { sqlstr += " insert into Wph_PackingPrint(Cade,[ADd],Special) values ('" + ds.Tables[0].Rows[i]["cade"].ToString() + "','" + ds.Tables[0].Rows[i]["ADd"].ToString() + "','" + ds.Tables[0].Rows[i]["Special"].ToString() + "');"; } } cmd = new SqlCommand(sqlstr, conn); cmd.ExecuteNonQuery(); } catch (Exception ex) { Console.WriteLine(ex.Message); } //唯品汇条码打印 DataTable dt = new DataTable(); string Rouet = Application.StartupPath + "\\PrintRoute.xml"; string printR = ""; dt = xmldate.CXmlToDataTable(Rouet); for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["FormID"].ToString() == "唯品汇条码打印") { printR = dt.Rows[i]["Route"].ToString(); } } Report.LoadFromFile(@printR); Report.ConnectionString = sqlcon.XMLIP(); Report.QuerySQL = "select * from Wph_PackingPrint"; conn.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message); } if (MessageBox.Show("\n“是”直接打印,“否”打印预览!!", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { Report.Print(true); } else { Report.PrintPreview(true); } //if() //Report.PrintPreview(true); //Report.Print(true); conn.Open(); SqlCommand cmdd = new SqlCommand("delete from Wph_PackingPrint", conn); cmdd.ExecuteNonQuery(); conn.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }