コード例 #1
0
        private void GenerateJL(mReport1 master, string projectTimeState, ref DateTime startDate, ref DateTime endDate, string work_, string function_)
        {
            LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManhoursPerPhase printManhoursPerPhase = new LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManhoursPerPhase();

            int? countryId = null;

            if (ddlCountry.SelectedIndex > 0)
            {
                countryId = Convert.ToInt32(ddlCountry.SelectedValue);
            }

            if (ddlClient.SelectedValue == "-1")
            {
                printManhoursPerPhase.LoadByStartDateEndDateProjectTimeStateWorkFunction(countryId, startDate, endDate, projectTimeState, work_, function_);
            }
            else
            {
                if (ddlProject.SelectedValue == "-1")
                {
                    printManhoursPerPhase.LoadByCompaniesIdStartDateEndDateProjectTimeStateWorkFunction(int.Parse(ddlClient.SelectedValue), startDate, endDate, projectTimeState, work_, function_);
                }
                else
                {
                    printManhoursPerPhase.LoadByCompaniesIdProjectIdStartDateEndDateProjectTimeStateWorkFunction(int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), startDate, endDate, projectTimeState, work_, function_);
                }
            }

            // ... set properties to master page
            master.Data = printManhoursPerPhase.Data;
            master.Table = printManhoursPerPhase.TableName;

            // Get report
            if (printManhoursPerPhase.Table.Rows.Count > 0)
            {
                if (master.Format == "pdf")
                {
                    switch (function_)
                    {
                        case "Install":
                            master.Report = new LiquiForce.LFSLive.WebUI.LabourHours.ProjectTime.PrintManhoursPerPhaseReport();
                            break;

                        case "Prep from Main":
                            master.Report = new LiquiForce.LFSLive.WebUI.LabourHours.ProjectTime.PrintManhoursPerPhaseReportJLPrepFromMain();
                            break;

                        case "Scoping":
                            master.Report = new LiquiForce.LFSLive.WebUI.LabourHours.ProjectTime.PrintManhoursPerPhaseReportJLScoping();
                            break;
                    }
                }
                else
                {
                    switch (function_)
                    {
                        case "Install":
                            master.Report = new LiquiForce.LFSLive.WebUI.LabourHours.ProjectTime.PrintManhoursPerPhaseReportExport();
                            break;

                        case "Prep from Main":
                            master.Report = new LiquiForce.LFSLive.WebUI.LabourHours.ProjectTime.PrintManhoursPerPhaseReportJLPrepFromMainExport();
                            break;

                        case "Scoping":
                            master.Report = new LiquiForce.LFSLive.WebUI.LabourHours.ProjectTime.PrintManhoursPerPhaseReportJLScopingExport();
                            break;
                    }
                }

                // ... set parameters to report
                if (master.Format == "pdf")
                {
                    // ... For report
                    // ... ... project time state
                    if (ddlProjectTimeState.SelectedValue == "(All)")
                    {
                        master.SetParameter("projectTimeState", "All");
                    }
                    else
                    {
                        master.SetParameter("projectTimeState", ddlProjectTimeState.SelectedItem.Text);
                    }

                    // ... ...  user
                    int loginId = Convert.ToInt32(Session["loginID"]);
                    int companyId = Convert.ToInt32(Session["companyID"]);

                    LoginGateway loginGateway = new LoginGateway();
                    loginGateway.LoadByLoginId(loginId, companyId);
                    string user = loginGateway.GetLastName(loginId, companyId) + " " + loginGateway.GetFirstName(loginId, companyId);
                    master.SetParameter("User", user.Trim());

                    // ... ... client
                    if (ddlClient.SelectedValue == "-1")
                    {
                        master.SetParameter("client", "All");
                    }
                    else
                    {
                        string clientName = ddlClient.SelectedItem.Text;
                        master.SetParameter("client", clientName);
                    }

                    // ... ... project
                    if (ddlProject.SelectedValue == "-1")
                    {
                        master.SetParameter("project", "All");
                    }
                    else
                    {
                        string project = ddlProject.SelectedItem.Text;
                        master.SetParameter("project", project);
                    }

                    // ... ... phase / function
                    if (ddlPhase.SelectedValue == "Scoping")
                    {
                        master.SetParameter("phase", "PreVideo & Locate (V1)");
                    }
                    else
                    {
                        master.SetParameter("phase", ddlPhase.SelectedValue);
                    }

                    // ... ... Dates Range
                    master.SetParameter("dateFrom", tkrdpStartDate.SelectedDate.Value.ToShortDateString());
                    master.SetParameter("dateTo", tkrdpEndDate.SelectedDate.Value.ToShortDateString());
                }
            }
        }
コード例 #2
0
        // ////////////////////////////////////////////////////////////////////////
        // PRIVATE METHODS
        //
        /// <summary>
        /// UpdateForReport
        /// </summary>
        private void UpdateForReport(DateTime startDate, DateTime endDate, string projectTimeState, int companyId, string confirmedSize1, string confirmedSize2, string accessType, string shape, int conditionRating, string location, string material, string crew)
        {
            LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManhoursPerPhase printManhoursPerPhaseJL = new LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManhoursPerPhase(Data);
            LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManHoursPerPhaseRA printManhoursPerPhaseRA = new LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManHoursPerPhaseRA(Data);
            LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManhoursPerPhaseFLL printManhoursPerPhaseFLL = new LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManhoursPerPhaseFLL(Data);
            LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManHoursPerPhaseMH printManhoursPerPhaseMH = new LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManHoursPerPhaseMH(Data);
            LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManHoursPerPhasePL printManhoursPerPhasePL = new LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManHoursPerPhasePL(Data);

            foreach (PrintManhoursPerPhaseTDS.PrintManHoursPerPhaseGeneralRow row in (PrintManhoursPerPhaseTDS.PrintManHoursPerPhaseGeneralDataTable)Table)
            {
                int clientId = row.ClientID;
                int projectId = row.ProjectID;
                int countryId = row.CountryID;

                printManhoursPerPhaseJL.LoadAllByCompaniesIdProjectIdStartDateEndDateProjectTimeStateWorkFunction(clientId, projectId, startDate, endDate, projectTimeState, "Junction Lining", "");
                printManhoursPerPhaseRA.LoadAllByCompaniesIdProjectIdStartDateEndDateProjectTimeStateWorkFunction(clientId, projectId, startDate, endDate, projectTimeState, "Rehab Assessment", "", companyId, confirmedSize1, confirmedSize2, accessType);
                printManhoursPerPhaseFLL.LoadAllByCompaniesIdProjectIdStartDateEndDateProjectTimeStateWorkFunction(clientId, projectId, startDate, endDate, projectTimeState, "Full Length", "", companyId, confirmedSize1, confirmedSize2, accessType);
                printManhoursPerPhaseMH.LoadAllByCompaniesIdProjectIdStartDateEndDateProjectTimeStateWorkFunction(clientId, projectId, startDate, endDate, projectTimeState, "MH Rehab", "", companyId, shape, conditionRating, location, material, crew);
                printManhoursPerPhasePL.LoadAllByCompaniesIdProjectIdStartDateEndDateProjectTimeStateWorkFunction(clientId, projectId, startDate, endDate, projectTimeState, "Point Lining", "", companyId, confirmedSize1, confirmedSize2, accessType);
            }
        }