/// <summary> /// 获取报告数据,不涉及模板 /// </summary> /// <param name="ordernum"></param> /// <returns></returns> public Hashtable getPrintData(string ordernum, string dictreporttemplateid) { string repCode = string.Empty; string repID = string.Empty; Dictreporttemplate dictreporttemplate = repService.GetDictreporttemplateByID(dictreporttemplateid); if (dictreporttemplate != null) { repCode = dictreporttemplate.Templatecode.ToString(); repID = dictreporttemplate.Reporttype.ToString(); } string dsjson = string.Empty; //根据体检号去体检报告数据表中查找记录 Orderreportdata optdata = optService.GetOrderreportdata(ordernum); if (optdata != null) { dsjson = optdata.ReportData; } else//体检报告数据表中没有数据则实时去数据库查询填充报告需要的数据 { DataSet ds = repServeic.GetReportData(ordernum, repID); dsjson = Serialize(ds); } Hashtable htPrint = new Hashtable(); htPrint.Add("repCode", repCode); htPrint.Add("dsjson", dsjson); return(htPrint); }
//加载当前行至编辑框 protected void SetEditDate() { //新增 reporttemplate = new Dictreporttemplate(); SimpleFormEdit.Title = "当前状态-新增"; //编辑 if (gridReportList.SelectedRowIndexArray.Length > 0) { SimpleFormEdit.Title = "当前状态-编辑"; string[] row = gridReportList.Rows[gridReportList.SelectedRowIndexArray[0]].Values; reporttemplate.Dictreporttemplateid = TypeParse.StrToDouble(row[0], 0); reporttemplate.Templatename = TypeParse.ObjToStr(row[1], ""); reporttemplate.Templatecode = TypeParse.ObjToStr(row[2], ""); reporttemplate.Papersize = TypeParse.ObjToStr(row[3], ""); reporttemplate.Singleappraise = TypeParse.ObjToStr(row[4], ""); reporttemplate.Reporttype = TypeParse.StrToDouble(row[5], 0); reporttemplate.Remark = TypeParse.ObjToStr(row[6], ""); } txtTemName.Text = reporttemplate.Templatename; txtTemCode.Text = reporttemplate.Templatecode; txtPageSize.Text = reporttemplate.Papersize; cbSingleAppraise.Checked = reporttemplate.Singleappraise == "0" ? true : false; dropReportType.SelectedValue = reporttemplate.Reporttype.ToString(); txtRemark.Text = reporttemplate.Remark; }
public Hashtable PrintReport3(string orderNum, UserInfo userInfo, int isPrint) { fReport.Clear(); string reportID = string.Empty; string reportCode = string.Empty; Orders orders = orderService.SelectOrdersByOrdernum(orderNum); if (orders != null) { Dictreporttemplate dictreporttemplate = repService.GetDictreporttemplateByID(orders.Dictreporttemplateid.ToString()); if (dictreporttemplate != null) { reportCode = dictreporttemplate.Templatecode.ToString(); reportID = dictreporttemplate.Reporttype.ToString(); } } string path = HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["path"].ToString()); fReport = repServeic.GetReport(orderNum, reportCode, reportID, new DataSet(), path, out dsGetReportData, isPrint); string reportString = Serialize(fReport.SaveToString()); string dsString = Serialize(dsGetReportData); string printerString = string.Empty; initlocalsetting.Hostmac = userInfo.initlocalsetting.Hostmac; initlocalsetting = initlocalsettingService.GetInitlocalsettingInfo(initlocalsetting); try { if (reportID == ((int)ParamStatus.ReportTypeStatus.ChcekOrder).ToString() || reportID == ((int)ParamStatus.ReportTypeStatus.Financial).ToString() || reportID == ((int)ParamStatus.ReportTypeStatus.GroupOrder).ToString() || reportID == ((int)ParamStatus.ReportTypeStatus.Normal).ToString()) { printerString = initlocalsetting.A4printer.ToString(); } else if (reportID == ((int)ParamStatus.ReportTypeStatus.HPV).ToString() || reportID == ((int)ParamStatus.ReportTypeStatus.MoneyOrder).ToString() || reportID == ((int)ParamStatus.ReportTypeStatus.TM15).ToString()) { printerString = initlocalsetting.A5printer.ToString(); } } catch (Exception e) { throw new Exception("请先设置打印机"); } Hashtable ht = new Hashtable(); ht.Add("printer", printerString); ht.Add("json", reportString); ht.Add("dsjson", dsString); return(ht); }
public string GetSerializeReportDate(string orderNumber) { Orders orders = orderService.SelectOrdersByOrdernum(orderNumber); string repId = string.Empty; if (orders != null) { Dictreporttemplate dictreporttemplate = repService.GetDictreporttemplateByID(orders.Dictreporttemplateid.ToString()); if (dictreporttemplate != null) { repId = dictreporttemplate.Reporttype.ToString(); } } DataSet ds = repServeic.GetReportData(orderNumber, repId); return(SerializationHelper.Serialize(ds)); }
/// <summary> /// 传入体检流水号取对应的报告,winform程序调用 /// </summary> /// <param name="order_num">体检流水号</param> /// <param name="parth">报告模板路径</param> /// <returns></returns> public Report GetReport(String order_num, string parth) { fReport.Clear(); repID = "";//报告模板ID Orders orders = orderService.SelectOrdersByOrdernum(order_num); if (orders != null) { Dictreporttemplate dictreporttemplate = repService.GetDictreporttemplateByID(orders.Dictreporttemplateid.ToString()); if (dictreporttemplate != null) { reporttemplateCode = dictreporttemplate.Templatecode; repID = dictreporttemplate.Reporttype.ToString(); } } fReport = repServeic.GetReport(order_num, reporttemplateCode, repID, new DataSet(), parth, out dsGetReportData, 2);//winform需要注册数据,所以这里为2 return(fReport); }
public DataSet dsGetReportData = new DataSet();//取得报表数据源 #region 入体检流水号取对应的报告,web调用 /// <summary> /// 传入体检流水号取对应的报告,web调用 /// </summary> /// <param name="order_num">体检号</param> /// <param name="isprint">1为打印2为预览</param> /// <returns></returns> public Report GetReport(String order_num, int isprint) { fReport.Clear(); repID = "";//报告模板ID Orders orders = orderService.SelectOrdersByOrdernum(order_num); if (orders != null) { Dictreporttemplate dictreporttemplate = repService.GetDictreporttemplateByID(orders.Dictreporttemplateid.ToString()); if (dictreporttemplate != null) { reporttemplateCode = dictreporttemplate.Templatecode.ToString(); repID = dictreporttemplate.Reporttype.ToString(); } } fReport = repServeic.GetReport(order_num, reporttemplateCode, repID, new DataSet(), HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings["path"].ToString()), out dsGetReportData, isprint); return(fReport); }
public static ReportTemplateInfo ToReportTemplateInfo(this Dictreporttemplate domainReporttemplate) { if (domainReporttemplate == null) { return(null); } var model = new ReportTemplateInfo(); model.Id = domainReporttemplate.Dictreporttemplateid.HasValue ? (int)domainReporttemplate.Dictreporttemplateid : 0; model.Name = domainReporttemplate.Templatename; model.Code = domainReporttemplate.Templatecode; model.ReportType = domainReporttemplate.Reporttype.HasValue ? (int)domainReporttemplate.Reporttype : 0; model.PaperSize = domainReporttemplate.Papersize; model.SingleAppraise = domainReporttemplate.Singleappraise; return(model); }
//加载文本框数据至对象 protected bool GetEditDate() { reporttemplate = new Dictreporttemplate(); if (gridReportList.SelectedRowIndexArray.Count <int>() > 0) { string[] row = gridReportList.Rows[gridReportList.SelectedRowIndexArray[0]].Values; reporttemplate.Dictreporttemplateid = Convert.ToDouble(row[0]); } else { reporttemplate.Dictreporttemplateid = 0; } if (!this.txtPageSize.Text.Trim().Equals("")) { reporttemplate.Papersize = this.txtPageSize.Text.Trim(); } else { erreyType = "纸张类型不能为空!"; return(false); } reporttemplate.Remark = this.txtRemark.Text.Trim(); reporttemplate.Reporttype = double.Parse(this.dropReportType.SelectedValue); reporttemplate.Singleappraise = this.cbSingleAppraise.Checked ? "1" : "0"; if (!this.txtTemCode.Text.Trim().Equals("")) { reporttemplate.Templatecode = this.txtTemCode.Text.Trim(); } else { erreyType = "模板代码不能为空!"; return(false); } if (!this.txtTemName.Text.Trim().Equals("")) { reporttemplate.Templatename = this.txtTemName.Text.Trim(); } else { erreyType = "模板名称不能为空!"; return(false); } return(reportService.SaveReporttemplate(reporttemplate)); }
/// <summary> /// 获取报告填充数据。完成总检后生成序列化报告数据时调用 /// </summary> /// <param name="ordernum"></param> /// <returns></returns> public string GetSerializeReportDate(string ordernum) { //根据体检号获取报告模板和数据 Orders orders = orderService.SelectOrdersByOrdernum(ordernum); string repID = string.Empty; if (orders != null) { Dictreporttemplate dictreporttemplate = repService.GetDictreporttemplateByID(orders.Dictreporttemplateid.ToString()); if (dictreporttemplate != null) { repID = dictreporttemplate.Reporttype.ToString(); } } DataSet ds = repServeic.GetReportData(ordernum, repID); string dsjson = Serialize(ds); return(dsjson); }
///<summary> ///新增编辑后保存 ///</summary> ///<param name="library"></param> /// <returns></returns> public bool SaveReporttemplate(Dictreporttemplate library) { DictreporttemplateService service = new DictreporttemplateService(); int nflag = 0; //新增 if (library.Dictreporttemplateid == 0) { try { library.Dictreporttemplateid = getSeqID("SEQ_DICTREPORTTEMPLATE"); service.insert("Dict.Insertreporttemplate", library); nflag = 1; //日志 fhp List <LogInfo> logLst = getLogInfo <Dictreporttemplate>(new Dictreporttemplate(), library); AddMaintenanceLog("DICTREPORTTEMPLATE", int.Parse(library.Dictreporttemplateid.ToString()), logLst, "新增", library.Templatename, library.Templatecode, modulename); } catch (Exception ex) { nflag = 0; throw new Exception(ex.Message); } } else//保存 { try { //获取旧对象fhp Dictreporttemplate dictreporttemplate = GetDictreporttemplateByID(library.Dictreporttemplateid.ToString()); nflag = service.update("Dict.Updatereporttemplate", library); //日志 fhp List <LogInfo> logLst = getLogInfo <Dictreporttemplate>(dictreporttemplate, library); AddMaintenanceLog("DICTREPORTTEMPLATE", int.Parse(library.Dictreporttemplateid.ToString()), logLst, "修改", library.Templatename, library.Templatecode, modulename); } catch (Exception ex) { throw new Exception(ex.Message); } } return(nflag > 0 ? true : false); }
/// <summary> /// 暂未使用 /// </summary> /// <param name="ordernum"></param> /// <returns></returns> public Hashtable getPrintReportDate(string ordernum) { string path = System.Configuration.ConfigurationManager.AppSettings["SerializeReportDateFile"].ToString(); string path2 = path + ordernum.Substring(0, 6); string rep_filename = path2 + "\\" + ordernum + "_rep.bin"; Hashtable htPrint = new Hashtable(); if (File.Exists(rep_filename)) { htPrint = DesrializeReportDataFromFile(rep_filename); } else//如果没有预先生成的文件,则通过读取数据库填充报告模板 { //根据体检号获取报告模板和数据 Orders orders = orderService.SelectOrdersByOrdernum(ordernum); string repCode = string.Empty; string repID = string.Empty; if (orders != null) { Dictreporttemplate dictreporttemplate = repService.GetDictreporttemplateByID(orders.Dictreporttemplateid.ToString()); if (dictreporttemplate != null) { repCode = dictreporttemplate.Templatecode.ToString(); repID = dictreporttemplate.Reporttype.ToString(); } } string reportTemplatePath = HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["path"].ToString()); DataSet dsReportData = new DataSet(); Report rep = repServeic.GetReport(ordernum, repCode, repID, new DataSet(), reportTemplatePath, out dsReportData, 1); //序列化报告模板和数据 htPrint["json"] = Serialize(rep.SaveToString()); htPrint["dsjson"] = Serialize(dsReportData); //throw new Exception(string.Format("未读取到体检号为{0}的报告序列化文件!",ordernum)); } return(htPrint); }