コード例 #1
0
    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();
        }
    }
コード例 #2
0
    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 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();
        }
    }
コード例 #4
0
    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 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();
        }
    }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ProcessExcelReport report = new ProcessExcelReport();

        report.Name     = "InventoryReport";
        report.Response = Response;

        report.RenderReport();
    }
コード例 #7
0
    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>");
        }
    }
コード例 #8
0
    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>");
        }
    }
コード例 #9
0
    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();
        }
    }
コード例 #10
0
    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();
        }
    }
コード例 #11
0
    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();
        }
    }
    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();
            }
        }
    }
コード例 #13
0
    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>");
        }
    }
コード例 #14
0
    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);
        }
    }
コード例 #15
0
    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();
        }
    }