public PublishReportResponse PublishReport(PublishReportRequest Request) { try { PublishReportResponse result = new PublishReportResponse(); Epi.Web.Interfaces.DataInterfaces.IReportDao IReportDao = new EF.EntityReportDao(); Epi.Web.BLL.Report Implementation = new Epi.Web.BLL.Report(IReportDao); ReportInfoBO ReportInfoBO = Mapper.ToReportInfoBO(Request.ReportInfo); Implementation.PublishReport(ReportInfoBO); result.Message = "The report was successfully published"; var ReportInfo = new ReportInfoDTO(); ReportInfo.ReportURL = ConfigurationManager.AppSettings["ReportURL"] + Request.ReportInfo.ReportId; result.Reports = new List <ReportInfoDTO>(); result.Reports.Add(ReportInfo); return(result); } catch (Exception ex) { CustomFaultException customFaultException = new CustomFaultException(); customFaultException.CustomMessage = ex.Message; customFaultException.Source = ex.Source; customFaultException.StackTrace = ex.StackTrace; customFaultException.HelpLink = ex.HelpLink; throw new FaultException <CustomFaultException>(customFaultException); } }
public static ReportInfoBO ToReportInfoBO(ReportInfoDTO reportInfo) { ReportInfoBO ReportInfoBO = new ReportInfoBO(); ReportInfoBO.CreatedDate = reportInfo.CreatedDate; ReportInfoBO.EditedDate = reportInfo.EditedDate; ReportInfoBO.ReportId = reportInfo.ReportId; ReportInfoBO.ReportVersion = reportInfo.ReportVersion; ReportInfoBO.SurveyId = reportInfo.SurveyId; ReportInfoBO.ReportURL = reportInfo.ReportURL; ReportInfoBO.Gadgets = ToReportInfoBOList(reportInfo.Gadgets); ReportInfoBO.RecordCount = reportInfo.RecordCount; ReportInfoBO.DataSource = reportInfo.DataSource; return(ReportInfoBO); }
public static ReportInfoDTO ToReportInfoDTO(ReportInfoBO reportInfo) { ReportInfoDTO ReportDTO = new ReportInfoDTO(); ReportDTO.CreatedDate = reportInfo.CreatedDate; ReportDTO.EditedDate = reportInfo.EditedDate; ReportDTO.ReportId = reportInfo.ReportId; ReportDTO.ReportVersion = reportInfo.ReportVersion; ReportDTO.SurveyId = reportInfo.SurveyId; ReportDTO.DataSource = reportInfo.DataSource; ReportDTO.RecordCount = reportInfo.RecordCount; if (reportInfo.Gadgets != null) { ReportDTO.Gadgets = ToGadgetsListDTO(reportInfo.Gadgets); } return(ReportDTO); }