public ShowHtmlDataDto GetReportViewer2(string reportID, string loginDomain, string loginSite, string printTemplateID) { List <ProcedureDto> procedureDtos = GetProcedureByReportID(reportID).ToList(); ProcedureDto procedure = procedureDtos[0]; DataTable dt; string templateInfo = ""; //use store procedure Order order = _dbContext.Set <Order>().Where(p => p.UniqueID == procedure.OrderID).FirstOrDefault(); string accNo = order.AccNo; string modalityType = procedure.ModalityType; ReportDBService reportDBService = new ReportDBService(); string templateID = ""; reportDBService.GetReportPrintTemplate(accNo, modalityType, reportID, loginSite, out templateID, out dt); //print templateID if (!string.IsNullOrEmpty(printTemplateID)) { Report report = _dbContext.Set <Report>().Where(r => r.UniqueID == reportID).FirstOrDefault(); if (report != null && report.Status < (int)RPStatus.FirstApprove) { templateID = printTemplateID; } } if (templateID != "") { PrintTemplate printTemplate = _dbContext.Set <PrintTemplate>().Where(p => p.UniqueID == templateID).FirstOrDefault(); if (printTemplate != null) { templateInfo = generatePrintTemplate(printTemplate); } } else { return(null); } string templateGuid = ReportUtils.GetFirstRowValueFromDataSet(dt.DataSet, ReportCommon.FIELDNAME_tbReport__PrintTemplateGuid); DataTable newdt = generateDataTable4PrintingForReport(dt.DataSet, ref templateInfo, reportID, loginDomain); using (MemoryStream ms = new MemoryStream()) { BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(ms, newdt); return(new ShowHtmlDataDto { Template = templateInfo, data = Convert.ToBase64String(ms.ToArray()) }); } }
public string GetOtherReportPrintID(string accno, string modalityType, string templateType, string site) { var service = new ReportDBService(); string template = String.Empty; DataTable data = null; string templateID = ""; service.GetOtherReportPrintTemplate(accno, modalityType, templateType, site, out template, out data, 1, out templateID); return(templateID); }
public PrintDataDto GetOtherReportPrintData(string accno, string modalityType, string templateType, string site) { var service = new ReportDBService(); string template = String.Empty; DataTable data = null; string templateID = ""; service.GetOtherReportPrintTemplate(accno, modalityType, templateType, site, out template, out data, 0, out templateID); return(new PrintDataDto { Template = template, data = data }); }
/// <summary> /// 获取用户权限配置 /// </summary> /// <param name="userID"></param> /// <returns></returns> public string GetUserProfiles(string userID) { if (string.IsNullOrEmpty(userID)) { return(null); } var user = _dbContext.Set <User>().Where(u => u.UniqueID == userID).FirstOrDefault(); if (user != null) { var reportDbService = new ReportDBService(); var ds = reportDbService.GetUserProfDetDataSet(userID, user.Domain); string json = JsonConvert.SerializeObject(ds); return(json); } //var query = (from u in _dbContext.Set<UserProfile>() // join m in _dbContext.Set<Module>() on u.ModuleID equals m.ModuleID // where (u.IsHidden & 1) == 1 // && u.UserID == userID // orderby u.OrderingPos descending // select new UserProDto // { // UniqueID = u.UniqueID, // RoleName = u.RoleName, // Name = u.Name, // ModuleID = u.ModuleID, // //ModuleName = m.Title, // Value = u.Value, // UserID = u.UserID, // Domain = u.Domain, // IsExportable = u.IsExportable, // PropertyDesc = u.PropertyDesc, // CanBeInherited = u.CanBeInherited, // PropertyType = u.PropertyType, // IsHidden = u.IsHidden == 1, // OrderingPos = u.OrderingPos // }).ToList(); //var result = query.Distinct(); //result.Select(p => //{ // //根据PropertyOptions 获得下拉列表集 // return p; //}); return(null); }
public bool UpdateReportPrintStatusByProcedureID(string procedureID, string printer, string site, string domain) { bool result = false; var procedure = _dbContext.Set <Procedure>().Where(p => p.UniqueID == procedureID).FirstOrDefault(); if (procedure != null && !String.IsNullOrEmpty(procedure.ReportID)) { var report = _dbContext.Set <Report>().Where(p => p.UniqueID == procedure.ReportID).FirstOrDefault(); var order = _dbContext.Set <Order>().Where(p => p.UniqueID == procedure.OrderID).FirstOrDefault(); var accNo = order.AccNo; var modalityType = procedure.ModalityType; var reportDBService = new ReportDBService(); var templateID = String.Empty; DataTable templateDT = null; reportDBService.GetReportPrintTemplate(accNo, modalityType, procedure.ReportID, site, out templateID, out templateDT); if (procedure.Status == (int)RPStatus.FirstApprove && !String.IsNullOrEmpty(templateID)) { report.IsPrint = 1; report.Optional1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //report.PrintCopies++; Will be handled in tbReportPrintLog trigger if (String.IsNullOrEmpty(report.PrintTemplateID)) { report.PrintTemplateID = templateID; } result = true; } // update report print log _reportPrintLogRepository.Add(new ReportPrintLog { UniqueID = Guid.NewGuid().ToString(), ReportID = procedure.ReportID, TemplateID = templateID, Printer = printer, PrintDate = DateTime.Now, Type = "Print", Counts = 1, Domain = domain }); _dbContext.SaveChanges(); } return(result); }
public string GetReportPrintTemplateID(string reportID, string loginDomain, string loginSite) { List <ProcedureDto> procedureDtos = GetProcedureByReportID(reportID).ToList(); ProcedureDto procedure = procedureDtos[0]; DataTable dt; //use store procedure Order order = _dbContext.Set <Order>().Where(p => p.UniqueID == procedure.OrderID).FirstOrDefault(); string accNo = order.AccNo; string modalityType = procedure.ModalityType; ReportDBService reportDBService = new ReportDBService(); string templateID = ""; reportDBService.GetReportPrintTemplate(accNo, modalityType, reportID, loginSite, out templateID, out dt); return(templateID); }
public string GetReportViewer(string reportID, string loginDomain, string loginSite) { List <ProcedureDto> procedureDtos = GetProcedureByReportID(reportID).ToList(); ProcedureDto procedure = procedureDtos[0]; DataTable dt; string templateInfo = ""; //use store procedure Order order = _dbContext.Set <Order>().Where(p => p.UniqueID == procedure.OrderID).FirstOrDefault(); string accNo = order.AccNo; string modalityType = procedure.ModalityType; ReportDBService reportDBService = new ReportDBService(); string templateID = ""; reportDBService.GetReportPrintTemplate(accNo, modalityType, reportID, loginSite, out templateID, out dt); if (templateID != "") { PrintTemplate printTemplate = _dbContext.Set <PrintTemplate>().Where(p => p.UniqueID == templateID).FirstOrDefault(); if (printTemplate != null) { templateInfo = generatePrintTemplate(printTemplate); } } else { return(null); } string templateGuid = ReportUtils.GetFirstRowValueFromDataSet(dt.DataSet, ReportCommon.FIELDNAME_tbReport__PrintTemplateGuid); DataTable newdt = generateDataTable4PrintingForReport(dt.DataSet, ref templateInfo, reportID, loginDomain); DataSet newds = new DataSet(); newds.Tables.Add(newdt); //get html return(GetRenderedReportHtml(newds, templateInfo)); }
private int GetPatientExamNo(string patientID, string orderID) { ReportDBService reportDBService = new ReportDBService(); return(reportDBService.GetPatientExamNo(patientID, orderID)); }