private void GenerateRA(mReport1 master, string projectTimeState, string confirmedSize1, string confirmedSize2, string accessType, ref DateTime startDate, ref DateTime endDate, string work_, ref string function_, int companyId)
        {
            LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManHoursPerPhaseRA printManhoursPerPhase = new LiquiForce.LFSLive.BL.LabourHours.ProjectTime.PrintManHoursPerPhaseRA();

            int? countryId = null;

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

            if (ddlClient.SelectedValue == "-1")
            {
                // ... For specific type of work and specific function
                printManhoursPerPhase.LoadByStartDateEndDateProjectTimeStateWorkFunction(countryId, startDate, endDate, projectTimeState, work_, function_, companyId, confirmedSize1, confirmedSize2, accessType);
            }
            else
            {
                if (ddlProject.SelectedValue == "-1")
                {
                    // ... For specific type of work and specific function
                    printManhoursPerPhase.LoadByCompaniesIdStartDateEndDateProjectTimeStateWorkFunction(int.Parse(ddlClient.SelectedValue), startDate, endDate, projectTimeState, work_, function_, companyId, confirmedSize1, confirmedSize2, accessType);
                }
                else
                {
                    // ... For specific type of work and specific function
                    printManhoursPerPhase.LoadByCompaniesIdProjectIdStartDateEndDateProjectTimeStateWorkFunction(int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), startDate, endDate, projectTimeState, work_, function_, companyId, confirmedSize1, confirmedSize2, accessType);
                }
            }

            // ... 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 "Flush Video and Reaming":
                            master.Report = new LiquiForce.LFSLive.WebUI.LabourHours.ProjectTime.PrintManhoursPerPhaseReportRAPreFlush();
                            break;
                        //case "Pre-Video":
                        //    master.Report = new LiquiForce.LFSLive.WebUI.LabourHours.ProjectTime.PrintManhoursPerPhaseReportRAPreVideo();
                        //    break;
                    }
                }
                else
                {
                    switch (function_)
                    {
                        case "Flush Video and Reaming":
                            master.Report = new LiquiForce.LFSLive.WebUI.LabourHours.ProjectTime.PrintManhoursPerPhaseReportRAPreFlushExport();
                            break;
                        //case "Pre-Video":
                        //    master.Report = new LiquiForce.LFSLive.WebUI.LabourHours.ProjectTime.PrintManhoursPerPhaseReportRAPreVideoExport();
                        //    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"]);

                    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
                    {
                        int currentClientId = Int32.Parse(ddlClient.SelectedValue);

                        CompaniesGateway companiesGateway = new CompaniesGateway();
                        companiesGateway.LoadByCompaniesId(currentClientId, companyId);
                        master.SetParameter("Client", companiesGateway.GetName(currentClientId));
                    }

                    // ... ... project
                    if (ddlProject.SelectedValue == "-1")
                    {
                        master.SetParameter("project", "All");
                    }
                    else
                    {
                        int projectId2 = Int32.Parse(ddlProject.SelectedValue);
                        ProjectGateway projectGateway = new ProjectGateway();
                        projectGateway.LoadByProjectId(projectId2);
                        string project = projectGateway.GetName(projectId2);
                        master.SetParameter("project", project);
                    }

                    // ... ... phase / function
                    if (ddlPhase.SelectedValue == "(All)")
                    {
                        master.SetParameter("phase", "All");
                    }
                    else
                    {
                        master.SetParameter("phase", ddlPhase.SelectedItem.Text);
                    }

                    // ... ... Confirmed Size
                    if (ddlConfirmedSize.SelectedValue == "(All)")
                    {
                        master.SetParameter("ConfirmedSize", "All");
                    }
                    else
                    {
                        master.SetParameter("ConfirmedSize", ddlConfirmedSize.SelectedValue);
                    }

                    // ... ... Access Type
                    if (ddlAccessType.SelectedValue == "(All)")
                    {
                        master.SetParameter("AccessType", "All");
                    }
                    else
                    {
                        master.SetParameter("AccessType", ddlAccessType.SelectedValue);
                    }

                    master.SetParameter("dateFrom", tkrdpStartDate.SelectedDate.Value.ToShortDateString());
                    master.SetParameter("dateTo", tkrdpEndDate.SelectedDate.Value.ToShortDateString());
                }
            }
        }
        // ////////////////////////////////////////////////////////////////////////
        // 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);
            }
        }