protected void Page_Load(object sender, EventArgs e) { string reportStartDate = Request.QueryString.Get("ReportStartDate"); string reportEndDate = Request.QueryString.Get("ReportEndDate"); string reportType = Request.QueryString.Get("ReportType"); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "SitesReceivingMealsByDateRange"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "SitesReceivingMealsByDateRange"; report.Response = Response; report.RenderReport(); } }
protected void Page_Load(object sender, EventArgs e) { string reportType = Request.QueryString.Get("ReportType"); string reportStartDate = Request.QueryString.Get("ReportStartDate"); string reportEndDate = Request.QueryString.Get("ReportEndDate"); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.Name = "UnduplicatedParticipationReportByRange"; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.Name = "UnduplicatedParticipationReportByRange"; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Response = Response; report.RenderReport(); } }
protected void Page_Load(object sender, EventArgs e) { string reportType = Request.QueryString.Get("ReportType"); string reportStartDate = Request.QueryString.Get("ReportStartDate"); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.StartDate = reportStartDate; report.Name = "ProductionSheet"; report.Response = Response; string m_SQL = "EXEC spProductionReportInformation '" + reportStartDate + "'"; DataSet LabelCreation = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.StartDate = reportStartDate; report.Name = "ProductionSheet"; report.Response = Response; string m_SQL = "EXEC spProductionReportInformation '" + reportStartDate + "'"; DataSet LabelCreation = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); report.RenderReport(); } }
protected void Page_Load(object sender, EventArgs e) { string reportStartDate = Request.QueryString.Get("ReportStartDate"); string reportType = Request.QueryString.Get("ReportType"); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.StartDate = reportStartDate; report.Name = "DeliveryReport_ForExcel"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.StartDate = reportStartDate; report.Name = "DeliveryReport"; report.Response = Response; report.RenderReport(); } }
protected void Page_Load(object sender, EventArgs e) { string reportStartDate = Request.QueryString.Get("ReportStartDate"); // int numMealsPerBox = Request.QueryString.Get("txtMealsPerBox"); string reportType = Request.QueryString.Get("ReportType"); string bunCount = Request.QueryString.Get("BunCount"); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.StartDate = reportStartDate; report.BunCount = bunCount; report.Name = "ColdLabelReport"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.StartDate = reportStartDate; report.BunCount = bunCount; report.Name = "ColdLabelReport"; report.Response = Response; report.RenderReport(); } }
public async Task BuildReportAsync(ClaimsPrincipal user, string appKey, string signatureProvidedByTheClient, string remoteAddress, byte[] reportBody) { if (!Guid.TryParse(appKey, out var tempKey)) { _logger.Warn("Incorrect appKeyFormat: " + appKey + " from " + remoteAddress); throw new InvalidCredentialException("AppKey must be a valid GUID which '" + appKey + "' is not."); } var application = await GetAppAsync(appKey); if (application == null) { _logger.Warn("Unknown appKey: " + appKey + " from " + remoteAddress); throw new InvalidCredentialException("AppKey was not found in the database. Key '" + appKey + "'."); } if (!ReportValidator.ValidateBody(application.SharedSecret, signatureProvidedByTheClient, reportBody)) { await StoreInvalidReportAsync(appKey, signatureProvidedByTheClient, remoteAddress, reportBody); throw new AuthenticationException( "You either specified the wrong SharedSecret, or someone tampered with the data."); } var report = DeserializeBody(reportBody); if (report == null) { return; } // correct incorrect clients if (report.CreatedAtUtc > DateTime.UtcNow) { report.CreatedAtUtc = DateTime.UtcNow; } if (_filters.Any(x => !x(report))) { return; } var internalDto = new ProcessReport { ApplicationId = application.Id, RemoteAddress = remoteAddress, ContextCollections = report.ContextCollections.Select(ConvertCollection).ToArray(), CreatedAtUtc = report.CreatedAtUtc, DateReceivedUtc = DateTime.UtcNow, Exception = ConvertException(report.Exception), ReportId = report.ReportId, ReportVersion = report.ReportVersion }; await StoreReportAsync(user, internalDto); }
protected void Page_Load(object sender, EventArgs e) { string labelReportText = Request.QueryString.Get("LabelReportText"); ProcessReport report = new ProcessReport(); report.LabelText = labelReportText; report.Name = "CACFPProgramsLabelReport"; report.Response = Response; report.RenderReport(); }
protected void Page_Load(object sender, EventArgs e) { string reportStartDate = Request.QueryString.Get("ReportStartDate"); ProcessReport report = new ProcessReport(); report.StartDate = reportStartDate; report.Name = "AdjustedRecipeReport"; report.Response = Response; report.RenderReport(); }
protected void Page_Load(object sender, EventArgs e) { string createdMeal; string reportStartDate = Request.QueryString.Get("ReportStartDate"); string reportEndDate = Request.QueryString.Get("ReportEndDate"); string reportType = Request.QueryString.Get("ReportType"); string bagCount = Request.QueryString.Get("BagCount"); string sliceCount = Request.QueryString.Get("SliceCount"); string loafCount = Request.QueryString.Get("LoafCount"); string bunCount = Request.QueryString.Get("BunCount"); m_SQL = "DECLARE @CreatedMeal varchar(50) EXEC spInsertWeeklyOrderReportInformation " + sliceCount + ", " + loafCount + ", " + bunCount + ", " + bagCount + ", '" + reportStartDate + "', '" + reportEndDate + "', '" + User.Identity.Name + "', @CreatedMeal = @CreatedMeal OUTPUT SELECT @CreatedMeal as 'CreatedMeal'"; DataSet dailyCountReportCreation = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); createdMeal = GCFDGlobals.dbGetValue(dailyCountReportCreation.Tables[0].Rows[0], "CreatedMeal"); if (createdMeal != "-1") { if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "CACFPWeeklyOrderReport"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "CACFPWeeklyOrderReport"; report.Response = Response; report.RenderReport(); } } else { RegisterClientScriptBlock("", "<script>{ alert('Error creating CACFP Weekly Order Report.');window.close();}</script>"); } }
public void DetermineActivityType(ProcessReport processReport, params IInputActivityReport[] inputActivityReports) { if (inputActivityReports != null && inputActivityReports.Any()) { var reports = inputActivityReports.Where(x => x != null) .OrderBy(x => x.LatestActivity).ToList(); if (reports.Any()) { _latestActivity = reports.Last().LatestActivity; } } _processReport = processReport; }
/// <summary> /// Convert received report to our internal format /// </summary> /// <param name="report">client report</param> /// <param name="applicationId">application that we identified that the report belongs to</param> /// <returns>internal format</returns> public ErrorReportEntity ConvertReport(ProcessReport report, int applicationId) { ErrorReportException ex = null; if (report.Exception != null) { ex = ConvertException(report.Exception); } //var id = _idGeneratorClient.GetNextId(ErrorReportEntity.SEQUENCE); var contexts = report.ContextCollections.Select(x => new ErrorReportContextCollection(x.Name, x.Properties)).ToArray(); var dto = new ErrorReportEntity(applicationId, report.ReportId, report.CreatedAtUtc, ex, contexts); return(dto); }
private Task StoreReportAsync(ClaimsPrincipal user, ProcessReport report) { try { using (var session = _queue.BeginSession()) { session.EnqueueAsync(user, new Message(report)); session.SaveChanges(); } } catch (Exception ex) { _logger.Error( "Failed to StoreReport: " + JsonConvert.SerializeObject(new { model = report }), ex); } return(Task.FromResult <object>(null)); }
protected void Page_Load(object sender, EventArgs e) { string createdMeal; string reportStartDate = Request.QueryString.Get("ReportStartDate"); string reportType = Request.QueryString.Get("ReportType"); m_SQL = "DECLARE @CreatedMeal varchar(50) EXEC spInsertLabelInformationHot '" + reportStartDate + "', @CreatedMeal = @CreatedMeal OUTPUT SELECT @CreatedMeal as 'CreatedMeal'";; DataSet LabelCreation = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); createdMeal = GCFDGlobals.dbGetValue(LabelCreation.Tables[0].Rows[0], "CreatedMeal"); if (createdMeal != "-1") { if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.ReportID = createdMeal; report.Name = "LabelReport"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.ReportID = createdMeal; report.Name = "LabelReport"; report.Response = Response; report.RenderReport(); } } else { RegisterClientScriptBlock("", "<script>{ alert('No Meal Created For This Date. Please Choose Another Date.');window.close();}</script>"); } }
protected void Page_Load(object sender, EventArgs e) { string reportStartDate = Request.QueryString.Get("ReportStartDate"); string reportType = Request.QueryString.Get("ReportType"); string bagCount = Request.QueryString.Get("BagCount"); string sliceCount = Request.QueryString.Get("SliceCount"); string loafCount = Request.QueryString.Get("LoafCount"); string bunCount = Request.QueryString.Get("BunCount"); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.StartDate = reportStartDate; report.BagCount = bagCount; report.SliceCount = sliceCount; report.LoafCount = loafCount; report.BunCount = bunCount; report.Name = "SFSPDeliveryReport_ForExcel"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.StartDate = reportStartDate; report.BagCount = bagCount; report.SliceCount = sliceCount; report.LoafCount = loafCount; report.BunCount = bunCount; report.Name = "SFSPDeliveryReport"; report.Response = Response; report.RenderReport(); } }
protected void Page_Load(object sender, EventArgs e) { string reportType = Request.QueryString.Get("ReportType"); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.Name = "SFSPSiteInformationReport"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.Name = "SFSPSiteInformationReport"; report.Response = Response; report.RenderReport(); } }
protected void Page_Load(object sender, EventArgs e) { string reportID; string reportStartDate = Request.QueryString.Get("ReportStartDate"); string reportEndDate = Request.QueryString.Get("ReportEndDate"); string reportType = Request.QueryString.Get("ReportType"); m_SQL = "DECLARE @ReportID int EXEC spInsertCCKDistributionByCommunity '" + reportStartDate + "', '" + reportEndDate + "', '" + User.Identity.Name + "', @ReportID = @ReportID OUTPUT SELECT @ReportID AS 'ReportID'"; DataSet dailyCountReportCreation = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); reportID = GCFDGlobals.dbGetValue(dailyCountReportCreation.Tables[0].Rows[0], "ReportID"); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.Name = "CCKDistributionByCommunityReport"; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.ReportID = reportID; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.Name = "CCKDistributionByCommunityReport"; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.ReportID = reportID; report.Response = Response; report.RenderReport(); } }
// Handle the processing of a report private byte[] ProcessReportFile(string url, string file, string parms, DateTime lastUpdateTime, out string mimeType) { byte[] result = null; string source; mimeType = "text/html"; // set the default // try finding report in the server cache! IList il = _server.Cache.Find(url + (parms == null?"":parms), lastUpdateTime); if (il != null) { try { string cfile = (string)il[il.Count - 1]; result = _server.ReadCache.Read(cfile); mimeType = GetMimeType(cfile); // set mimetype based on file's extension } catch (Exception ex) { if (_server.TraceLevel >= 0) { Console.WriteLine("Cache read exception in ProcessReportFile: {0} {1}", il[0], ex.Message); } } return(result); } // Obtain the source if (!ProcessReportGetSource(file, out source)) { return(Encoding.ASCII.GetBytes(source)); // we got an error opening file; source contains html error text } // Compile the report string msgs = ""; Report report = ProcessReportCompile(file, source, out msgs); if (report == null) { mimeType = "text/html"; // force to html return(Encoding.ASCII.GetBytes(String.Format("<H2>Report '{0}' has the following syntax errors.</H2><p>{1}", url, msgs))); } // Obtain the result HTML from running the report string dbgFilename = ""; try { ListDictionary ld = ProcessReportGetParms(parms); // split parms into dictionary OutputPresentationType type; string stype = (string)ld["rs:Format"]; if (stype == null) { stype = "html"; } else { stype = stype.ToLower(); } switch (stype) { case "pdf": type = OutputPresentationType.PDF; break; case "xml": type = OutputPresentationType.XML; string ext = (string)ld["rs:FileExtension"]; if (ext != null) { stype = ext; } break; case "html": type = OutputPresentationType.HTML; break; default: type = OutputPresentationType.HTML; stype = "html"; break; } StreamGen sg = new StreamGen(serverRoot, WorkingDir, stype); ProcessReport pr = new ProcessReport(report, sg); pr.Run(ld, type); // handle any error messages if (report.ErrorMaxSeverity > 0) { string errs = null; if (report.ErrorMaxSeverity > 4) { mimeType = "text/html"; // force to html errs = "<H2>Severe errors encountered when running report.</H2>"; } foreach (String emsg in report.ErrorItems) { if (report.ErrorMaxSeverity > 4) { errs += ("<p>" + emsg + "</p>"); } else { if (_server.TraceLevel > 0) { Console.WriteLine(emsg); // output message to console } } } if (errs != null) { result = Encoding.ASCII.GetBytes(errs); } report.ErrorReset(); } // Only read the result if significant errors didn't occur if (result == null) { ReportRender rr = new ReportRender(report); rr.ActionUrl = "/" + url; string p = rr.ParameterHtml(ld); // put this into a file. string parmUrl; StreamWriter sw = null; try { sw = new StreamWriter(sg.GetIOStream(out parmUrl, "html")); sw.Write(p); } finally { if (sw != null) { sw.Close(); } } // Add it to the file list IList newlist = _server.Cache.Add(url + (parms == null?"":parms), sg.FileList); dbgFilename = (string)newlist[0]; // this is the first fully qualified name FileInfo fi = new FileInfo(dbgFilename); string mHtml = rr.MainHtml(report, parmUrl, sg.RelativeDirectory + fi.Name); string mUrl; sw = null; try { sw = new StreamWriter(sg.GetIOStream(out mUrl, "html")); sw.Write(mHtml); } finally { if (sw != null) { sw.Close(); } } result = Encoding.ASCII.GetBytes(mHtml); } } catch (Exception ex) { if (_server.TraceLevel >= 0) { Console.WriteLine("Exception in ProcessReportFile: {0} {1}", file, ex.Message); } result = Encoding.ASCII.GetBytes(string.Format("<H2>{0}</H2><p>{1}</p>", ex.Message, ex.StackTrace)); mimeType = "text/html"; // force to html } return(result); }
protected void Page_Load(object sender, EventArgs e) { string createdMeal; string reportStartDate = Request.QueryString.Get("ReportStartDate"); string reportEndDate = Request.QueryString.Get("ReportEndDate"); string mealType = Request.QueryString.Get("MealType"); string scheduleType = Request.QueryString.Get("ScheduleType"); string communityArea = Request.QueryString.Get("CommunityArea"); string siteName = Request.QueryString.Get("SiteName"); string reportType = Request.QueryString.Get("ReportType"); m_SQL = "DECLARE @CreatedMeal varchar(50) EXEC spInsertDailyCountReportInformation '" + reportStartDate + "', '" + reportEndDate + "', " + mealType + ", " + scheduleType + ",'" + communityArea + "', '" + siteName + "', '" + User.Identity.Name + "', @CreatedMeal = @CreatedMeal OUTPUT SELECT @CreatedMeal as 'CreatedMeal'"; DataSet dailyCountReportCreation = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); createdMeal = GCFDGlobals.dbGetValue(dailyCountReportCreation.Tables[0].Rows[0], "CreatedMeal"); if (createdMeal != "-1") { if (siteName == "-1" && mealType != "-1" && communityArea == "-1" && scheduleType == "-1") { m_SQL = "SELECT MealTypeName FROM MealTypeDict WHERE MealTypeID = " + mealType; DataSet MealTypeIDDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); //m_SQL = "SELECT ScheduleTypeName FROM ScheduleTypeDict WHERE ScheduleTypeID = " + scheduleType; //DataSet ScheduleTypeIDDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.MealType = GCFDGlobals.dbGetValue(MealTypeIDDataSet.Tables[0].Rows[0], "MealTypeName"); //report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReport"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.MealType = GCFDGlobals.dbGetValue(MealTypeIDDataSet.Tables[0].Rows[0], "MealTypeName"); //report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReport"; report.Response = Response; report.RenderReport(); } } else if (siteName == "-1" && mealType != "-1" && communityArea == "-1" && scheduleType != "-1") { m_SQL = "SELECT MealTypeName FROM MealTypeDict WHERE MealTypeID = " + mealType; DataSet MealTypeIDDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); m_SQL = "SELECT ScheduleTypeName FROM ScheduleTypeDict WHERE ScheduleTypeID = " + scheduleType; DataSet ScheduleTypeIDDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.MealType = GCFDGlobals.dbGetValue(MealTypeIDDataSet.Tables[0].Rows[0], "MealTypeName"); report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportByScheduleType"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.MealType = GCFDGlobals.dbGetValue(MealTypeIDDataSet.Tables[0].Rows[0], "MealTypeName"); report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportByScheduleType"; report.Response = Response; report.RenderReport(); } } else if (siteName == "-1" && mealType != "-1" && communityArea != "-1" && scheduleType == "-1") { m_SQL = "SELECT MealTypeName FROM MealTypeDict WHERE MealTypeID = " + mealType; DataSet MealTypeIDDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.MealType = GCFDGlobals.dbGetValue(MealTypeIDDataSet.Tables[0].Rows[0], "MealTypeName"); report.CommunityArea = communityArea; report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportByCommunityAreaMealType"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.MealType = GCFDGlobals.dbGetValue(MealTypeIDDataSet.Tables[0].Rows[0], "MealTypeName"); report.CommunityArea = communityArea; report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportByCommunityAreaMealType"; report.Response = Response; report.RenderReport(); } } else if (siteName == "-1" && mealType != "-1" && communityArea != "-1" && scheduleType != "-1") { m_SQL = "SELECT MealTypeName FROM MealTypeDict WHERE MealTypeID = " + mealType; DataSet MealTypeIDDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); m_SQL = "SELECT ScheduleTypeName FROM ScheduleTypeDict WHERE ScheduleTypeID = " + scheduleType; DataSet ScheduleTypeIDDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.MealType = GCFDGlobals.dbGetValue(MealTypeIDDataSet.Tables[0].Rows[0], "MealTypeName"); report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.CommunityArea = communityArea; report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportByCommunityAreaMealTypeScheduleType"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.MealType = GCFDGlobals.dbGetValue(MealTypeIDDataSet.Tables[0].Rows[0], "MealTypeName"); report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.CommunityArea = communityArea; report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportByCommunityAreaMealTypeScheduleType"; report.Response = Response; report.RenderReport(); } } else if (siteName == "-1" && mealType == "-1" && communityArea == "-1" && scheduleType == "-1") { if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportOrderedBySite"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.ReportID = createdMeal; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportOrderedBySite"; report.Response = Response; report.RenderReport(); } } else if (siteName == "-1" && mealType == "-1" && communityArea == "-1" && scheduleType != "-1") { m_SQL = "SELECT ScheduleTypeName FROM ScheduleTypeDict WHERE ScheduleTypeID = " + scheduleType; DataSet ScheduleTypeIDDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.ReportID = createdMeal; report.StartDate = reportStartDate; report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.EndDate = reportEndDate; report.Name = "NewDailyCountReportOrderedBySiteScheduleType"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.ReportID = createdMeal; report.StartDate = reportStartDate; report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.EndDate = reportEndDate; report.Name = "NewDailyCountReportOrderedBySiteScheduleType"; report.Response = Response; report.RenderReport(); } } else if (siteName != "-1" && mealType == "-1" && communityArea == "-1" && scheduleType == "-1") { if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.ReportID = createdMeal; report.SiteName = siteName; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportBySite"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.ReportID = createdMeal; report.SiteName = siteName; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportBySite"; report.Response = Response; report.RenderReport(); } } else if (siteName != "-1" && mealType == "-1" && communityArea == "-1" && scheduleType != "-1") { m_SQL = "SELECT ScheduleTypeName FROM ScheduleTypeDict WHERE ScheduleTypeID = " + scheduleType; DataSet ScheduleTypeIDDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.ReportID = createdMeal; report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.SiteName = siteName; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportBySite"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.ReportID = createdMeal; report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.SiteName = siteName; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportBySite"; report.Response = Response; report.RenderReport(); } } else if (siteName == "-1" && mealType == "-1" && communityArea != "-1" && scheduleType == "-1") { if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.ReportID = createdMeal; report.CommunityArea = communityArea; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportByCommunityArea"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.ReportID = createdMeal; report.CommunityArea = communityArea; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportByCommunityArea"; report.Response = Response; report.RenderReport(); } } else if (siteName == "-1" && mealType == "-1" && communityArea != "-1" && scheduleType != "-1") { m_SQL = "SELECT ScheduleTypeName FROM ScheduleTypeDict WHERE ScheduleTypeID = " + scheduleType; DataSet ScheduleTypeIDDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.ReportID = createdMeal; report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.CommunityArea = communityArea; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportByCommunityArea"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.ReportID = createdMeal; report.ScheduleType = GCFDGlobals.dbGetValue(ScheduleTypeIDDataSet.Tables[0].Rows[0], "ScheduleTypeName"); report.CommunityArea = communityArea; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.Name = "NewDailyCountReportByCommunityArea"; report.Response = Response; report.RenderReport(); } } } else { RegisterClientScriptBlock("", "<script>{ alert('Error creating Daily Count Report.');window.close();}</script>"); } }
public ProcessReportTests() { _processReport = new ProcessReport(); }
protected void Page_Load(object sender, EventArgs e) { string deliverySiteName; string m_SQL; string reportStartDate = Request.QueryString.Get("ReportStartDate"); string reportType = Request.QueryString.Get("ReportType"); m_SQL = "DELETE FROM DailyCountReport"; GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbExecuteSQLCmd(m_SQL); m_SQL = "SELECT DISTINCT SiteName FROM vwDelivery WHERE ServingDate BETWEEN '" + reportStartDate + "' AND DATEADD(d, 6, '" + reportStartDate + "') AND DeliveryTypeID IN (1,2) AND DeliveryDate <> '01/01/1900' AND MealTypeID = 2"; DataSet deliveryDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); m_SQL = "DECLARE @FirstDay smalldatetime, @NumberOfMonths int SELECT @FirstDay = '" + Convert.ToDateTime(reportStartDate).ToString("yyyyMMdd") + "';WITH Days AS (SELECT @FirstDay as CalendarDay UNION ALL SELECT DATEADD(d, 1, CalendarDay) as CalendarDay FROM Days WHERE DATEADD(d, 1, CalendarDay) < DATEADD(d, 6, '" + reportStartDate + "')) SELECT CONVERT(varchar(10), CalendarDay, 101) AS WeekdayDate FROM Days"; DataSet daysOfTheWeekDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); foreach (DataRow deliveryDataRow in deliveryDataSet.Tables[0].Rows) { deliverySiteName = GCFDGlobals.dbGetValue(deliveryDataRow, "SiteName"); foreach (DataRow weekdayDataRow in daysOfTheWeekDataSet.Tables[0].Rows) { m_SQL = "SELECT DISTINCT SiteName, LAHSiteCode, ServingDate, DATENAME(dw, ServingDate) AS WeekdayName, MealCount, MealTypeName FROM vwDelivery WHERE MealTypeID = 2 AND ((DeliveryTypeName = 'Scheduled') OR (DeliveryTypeName='Rescheduled' AND CONVERT(varchar(10), DeliveryDate, 101) <> '01/01/1900')) AND ServingDate = '" + GCFDGlobals.dbGetValue(weekdayDataRow, "WeekdayDate") + "' AND SiteName = '" + deliverySiteName + "'"; DataSet dailyCountDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); if (dailyCountDataSet.Tables[0].Rows.Count > 0) { m_SQL = "INSERT INTO DailyCountReport(ServingDate, SiteName, Sent, MealTypeName) VALUES('" + Convert.ToDateTime(GCFDGlobals.dbGetValue(weekdayDataRow, "WeekdayDate")).ToString("MM/dd/yyyy") + "', '" + deliverySiteName + "', " + GCFDGlobals.dbGetValue(dailyCountDataSet.Tables[0].Rows[0], "MealCount") + ", '" + GCFDGlobals.dbGetValue(dailyCountDataSet.Tables[0].Rows[0], "MealTypeName") + "')"; GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbExecuteSQLCmd(m_SQL); } else { m_SQL = "INSERT INTO DailyCountReport(ServingDate, SiteName, Sent, MealTypeName) VALUES('" + Convert.ToDateTime(GCFDGlobals.dbGetValue(weekdayDataRow, "WeekdayDate")).ToString("MM/dd/yyyy") + "', '" + deliverySiteName + "', 0, 'Cold')"; GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbExecuteSQLCmd(m_SQL); } } } m_SQL = "SELECT DISTINCT SiteName FROM vwDelivery WHERE ServingDate BETWEEN '" + reportStartDate + "' AND DATEADD(d, 6, '" + reportStartDate + "') AND DeliveryTypeID IN (1,2) AND DeliveryDate <> '01/01/1900' AND MealTypeID = 8"; deliveryDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); m_SQL = "DECLARE @FirstDay smalldatetime, @NumberOfMonths int SELECT @FirstDay = '" + Convert.ToDateTime(reportStartDate).ToString("yyyyMMdd") + "';WITH Days AS (SELECT @FirstDay as CalendarDay UNION ALL SELECT DATEADD(d, 1, CalendarDay) as CalendarDay FROM Days WHERE DATEADD(d, 1, CalendarDay) < DATEADD(d, 6, '" + reportStartDate + "')) SELECT CONVERT(varchar(10), CalendarDay, 101) AS WeekdayDate FROM Days"; daysOfTheWeekDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); foreach (DataRow deliveryDataRow in deliveryDataSet.Tables[0].Rows) { deliverySiteName = GCFDGlobals.dbGetValue(deliveryDataRow, "SiteName"); foreach (DataRow weekdayDataRow in daysOfTheWeekDataSet.Tables[0].Rows) { m_SQL = "SELECT DISTINCT SiteName, LAHSiteCode, ServingDate, DATENAME(dw, ServingDate) AS WeekdayName, MealCount, MealTypeName FROM vwDelivery WHERE MealTypeID = 8 AND ((DeliveryTypeName = 'Scheduled') OR (DeliveryTypeName='Rescheduled' AND CONVERT(varchar(10), DeliveryDate, 101) <> '01/01/1900')) AND ServingDate = '" + GCFDGlobals.dbGetValue(weekdayDataRow, "WeekdayDate") + "' AND SiteName = '" + deliverySiteName + "'"; DataSet dailyCountDataSet = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); if (dailyCountDataSet.Tables[0].Rows.Count > 0) { m_SQL = "INSERT INTO DailyCountReport(ServingDate, SiteName, Sent, MealTypeName) VALUES('" + Convert.ToDateTime(GCFDGlobals.dbGetValue(weekdayDataRow, "WeekdayDate")).ToString("MM/dd/yyyy") + "', '" + deliverySiteName + "', " + GCFDGlobals.dbGetValue(dailyCountDataSet.Tables[0].Rows[0], "MealCount") + ", '" + GCFDGlobals.dbGetValue(dailyCountDataSet.Tables[0].Rows[0], "MealTypeName") + "')"; GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbExecuteSQLCmd(m_SQL); } else { m_SQL = "INSERT INTO DailyCountReport(ServingDate, SiteName, Sent, MealTypeName) VALUES('" + Convert.ToDateTime(GCFDGlobals.dbGetValue(weekdayDataRow, "WeekdayDate")).ToString("MM/dd/yyyy") + "', '" + deliverySiteName + "', 0, 'Cold Breakfast (LAH)')"; GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbExecuteSQLCmd(m_SQL); } } } if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.StartDate = reportStartDate; report.Name = "ColdMealScheduleReport"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.StartDate = reportStartDate; report.Name = "ColdMealScheduleReport"; report.Response = Response; report.RenderReport(); } }
public void ReportProcess(ProcessReport processReport) { _activityReport.ProcessReport = processReport; _processReported = true; }
protected void Page_Load(object sender, EventArgs e) { string reportID; string reportStartDate = Request.QueryString.Get("ReportStartDate"); string reportEndDate = Request.QueryString.Get("ReportEndDate"); string communityArea = Request.QueryString.Get("CommunityArea"); string siteName = Request.QueryString.Get("SiteName"); string reportType = Request.QueryString.Get("ReportType"); m_SQL = "DECLARE @ReportID int EXEC spInsertSiteCountMealTotalReportByRange '" + communityArea + "', '" + siteName + "', '" + reportStartDate + "', '" + reportEndDate + "', '" + User.Identity.Name + "', @ReportID = @ReportID OUTPUT SELECT @ReportID AS 'ReportID'"; DataSet dailyCountReportCreation = GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbSelectDataSet(m_SQL); reportID = GCFDGlobals.dbGetValue(dailyCountReportCreation.Tables[0].Rows[0], "ReportID"); if (siteName == "-1" && communityArea == "-1") { if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.Name = "SiteCountMealTotalReportByRange"; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.ReportID = reportID; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.Name = "SiteCountMealTotalReportByRange"; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.ReportID = reportID; report.Response = Response; report.RenderReport(); } } else if (siteName != "-1") { if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.Name = "SiteCountMealTotalReportByRange_BySite"; report.SiteName = siteName; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.ReportID = reportID; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.Name = "SiteCountMealTotalReportByRange_BySite"; report.SiteName = siteName; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.ReportID = reportID; report.Response = Response; report.RenderReport(); } } else if (communityArea != "-1") { if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.Name = "SiteCountMealTotalReportByRange_ByCommunity"; report.CommunityArea = communityArea; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.ReportID = reportID; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.Name = "SiteCountMealTotalReportByRange_ByCommunity"; report.CommunityArea = communityArea; report.StartDate = reportStartDate; report.EndDate = reportEndDate; report.ReportID = reportID; report.Response = Response; report.RenderReport(); } } }
protected void Page_Load(object sender, EventArgs e) { string filePath = @"C:\InventoryReports\InventoryReport.xls"; //string filePath = @"\\gcfd-fpmain\site$\inventoryreport.xls"; string item = ""; string quantity = ""; string reportStartDate = Request.QueryString.Get("ReportStartDate"); string reportEndDate = Request.QueryString.Get("ReportEndDate"); string reportType = Request.QueryString.Get("ReportType"); NetworkDrive oNetDrive = new aejw.Network.NetworkDrive(); try { //oNetDrive.LocalDrive = "K:"; //oNetDrive.ShareName = @"\\10.99.1.36\shareCK$"; //oNetDrive.Persistent = false; //oNetDrive.MapDrive("admin.em", "arcgis@123"); //oNetDrive = null; OleDbConnection oconn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + "; Extended Properties=Excel 8.0");//OledbConnection and //OleDbConnection oconn = new OleDbConnection(@"Driver=ODBCDriver;server=GCFD-INTRANET;providerName=inventory");//OledbConnection and // connectionstring to connect to the Excel Sheet try { m_SQL = "DELETE FROM ItemOrder"; GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbExecuteSQLCmd(m_SQL); //After connecting to the Excel sheet here we are selecting the data //using select statement from the Excel sheet OleDbCommand ocmd = new OleDbCommand("SELECT * FROM [InventoryReport$]", oconn); oconn.Open(); //Here [Sheet1$] is the name of the sheet //in the Excel file where the data is present OleDbDataReader odr = ocmd.ExecuteReader(); while (odr.Read()) { item = valid(odr, 1);//Here we are calling the valid method quantity = valid(odr, 2); //Here using this method we are inserting the data into the database insertdataintosql(item, quantity); } oconn.Close(); } catch (DataException ee) { //lblmsg.Text = ee.Message; //lblmsg.ForeColor = System.Drawing.Color.Red; } m_SQL = "DELETE FROM MealRecipe"; GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbExecuteSQLCmd(m_SQL); m_SQL = "INSERT INTO MealRecipe (RecipeName, MealID) SELECT DISTINCT RecipeName, MealID FROM vwMealDelivery WHERE (DeliveryDate BETWEEN '" + reportStartDate + "' AND '" + reportEndDate + "') AND DeliveryTypeName <> 'Cancelled' AND MealTypeName IN('Hot','Breakfast') AND RecipeTypeID <> 11"; GCFDGlobals.m_GCFDPlannerDatabaseLibrary.dbExecuteSQLCmd(m_SQL); if (reportType == "Excel") { ProcessExcelReport report = new ProcessExcelReport(); report.Name = "InventoryOrderReport"; report.Response = Response; report.RenderReport(); } else { ProcessReport report = new ProcessReport(); report.Name = "InventoryOrderReport"; report.Response = Response; report.RenderReport(); } oNetDrive.LocalDrive = "M:"; oNetDrive.ShareName = @"\\10.99.1.36\shareCK$"; oNetDrive.UnMapDrive(); } catch (Exception err) { MessageBox.Show("Error: " + err.Message); } }