protected void grdTeamMembers_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            // Edit items
            if ((e.Row.RowType == DataControlRowType.DataRow) && ((e.Row.RowState == DataControlRowState.Edit) || (e.Row.RowState == (DataControlRowState.Edit | DataControlRowState.Alternate))))
            {
                int costingSheetId = Int32.Parse(((Label)e.Row.FindControl("lblCostingSheetIDEdit")).Text.Trim());
                int employeeId = Int32.Parse(((Label)e.Row.FindControl("lblEmployeeIDEdit")).Text.Trim());
                int refId = Int32.Parse(((Label)e.Row.FindControl("lblRefIDEdit")).Text.Trim());
                string work_ = ((Label)e.Row.FindControl("lblWork_Edit")).Text.Trim();

                ProjectCostingSheetAddLabourHoursInformationGateway projectCostingSheetAddLabourHoursInformationGateway = new ProjectCostingSheetAddLabourHoursInformationGateway(projectCostingSheetAddTDS);
                string unitOfMeasurement = projectCostingSheetAddLabourHoursInformationGateway.GetLHUnitOfMeasurement(costingSheetId, work_, employeeId, refId);
                ((DropDownList)e.Row.FindControl("ddlUnitOfMeasurementLHEdit")).SelectedValue = unitOfMeasurement;

                string unitOfMeasurementMeals = projectCostingSheetAddLabourHoursInformationGateway.GetMealsUnitOfMeasurement(costingSheetId, work_, employeeId, refId);
                ((DropDownList)e.Row.FindControl("ddlUnitsOfMeasurementLHMealsEdit")).SelectedValue = unitOfMeasurementMeals;

                string unitOfMeasurementMotel = projectCostingSheetAddLabourHoursInformationGateway.GetMotelUnitOfMeasurement(costingSheetId, work_, employeeId, refId);
                ((DropDownList)e.Row.FindControl("ddlUnitsOfMeasurementLHMotelEdit")).SelectedValue = unitOfMeasurementMotel;

                bool fromDatabase = projectCostingSheetAddLabourHoursInformationGateway.GetFromDatabase(costingSheetId, work_, employeeId, refId);

                if (fromDatabase)
                {
                    ((RadDatePicker)e.Row.FindControl("tkrdpEndDateEdit")).Calendar.Enabled = false;
                    ((RadDatePicker)e.Row.FindControl("tkrdpEndDateEdit")).DateInput.ReadOnly = true;

                    ((RadDatePicker)e.Row.FindControl("tkrdpStartDateEdit")).Calendar.Enabled = false;
                    ((RadDatePicker)e.Row.FindControl("tkrdpStartDateEdit")).DateInput.ReadOnly = true;
                }

                ((RadDatePicker)e.Row.FindControl("hdfFrom")).SelectedDate = tkrdpFrom.SelectedDate;
                ((RadDatePicker)e.Row.FindControl("hdfTo")).SelectedDate = tkrdpTo.SelectedDate;
            }

            // Footer Item
            if (e.Row.RowType == DataControlRowType.Footer)
            {
                ((RadDatePicker)e.Row.FindControl("hdfFrom")).SelectedDate = tkrdpFrom.SelectedDate;
                ((RadDatePicker)e.Row.FindControl("hdfTo")).SelectedDate = tkrdpTo.SelectedDate;
            }
        }
        // ////////////////////////////////////////////////////////////////////////
        // PUBLIC METHODS
        //
        public int LoadAll(DateTime startDate, DateTime endDate, int companyId, string month)
        {
            int rows = 0;

            PrintSummaryCostingSheetByMonthDummyInformationGateway printSummaryCostingSheetByMonthDummyInformationGateway = new PrintSummaryCostingSheetByMonthDummyInformationGateway(Data);
            printSummaryCostingSheetByMonthDummyInformationGateway.LoadProjectsWithTimesheets(startDate, endDate);

            // Load
            ProjectCostingSheetAddLabourHoursInformationGateway projectCostingSheetAddLabourHoursInformationGateway = new ProjectCostingSheetAddLabourHoursInformationGateway(Data);
            projectCostingSheetAddLabourHoursInformationGateway.ClearBeforeFill = false;
            ProjectCostingSheetAddLabourHoursInformation model = new ProjectCostingSheetAddLabourHoursInformation(Data);

            foreach (ProjectCostingSheetAddTDS.DummyInformationRow projectListRow in (ProjectCostingSheetAddTDS.DummyInformationDataTable)printSummaryCostingSheetByMonthDummyInformationGateway.Table)
            {
                int projectId = projectListRow.ProjectID;

                ProjectGateway projectGateway = new ProjectGateway();
                projectGateway.LoadByProjectId(projectId);

                ArrayList works = new ArrayList();
                works.Add("Rehab Assessment");
                works.Add("Full Length");
                works.Add("Point Lining"); works.Add("Grouting");
                works.Add("Junction Lining");
                works.Add("MH Rehab");
                works.Add("Mobilization");
                works.Add("Other");
                works.Add("Downtime");
                works.Add("Office");
                works.Add("Office / Shop");
                works.Add("R & D");
                works.Add("Special Projects");
                works.Add("Subcontractor");
                works.Add("Watermain Relining");
                works.Add("SOTA");

                if (!projectGateway.GetFairWageApplies(projectId))
                {
                    model.Load(works, projectId, startDate, endDate, companyId, month);
                }
                else
                {
                    ArrayList jobClassType = new ArrayList();
                    jobClassType.Add("Laborer Group 2");
                    jobClassType.Add("Laborer Group 6");
                    jobClassType.Add("Operator Group 1");
                    jobClassType.Add("Operator Group 2");
                    jobClassType.Add("Regular Rate");

                    model.LoadFairWageProject(works, jobClassType, projectId, startDate, endDate, companyId, month);
                }

                decimal totalCostLH = StepLabourHoursInformationProcessGrid();

                ProjectCostingSheetAddBasicInformation projectCostingSheetAddBasicInformation = new ProjectCostingSheetAddBasicInformation(Data);
                projectCostingSheetAddBasicInformation.Insert2(projectId, projectId, "", startDate, endDate, totalCostLH, totalCostLH, 0, 0, 0, 0, 0, 0, 0, 0, "", false, companyId, 0, 0, 0, 0, 0, 0, 0, 0, 0, month);

                rows = rows + projectCostingSheetAddLabourHoursInformationGateway.Table.Rows.Count;
            }

            projectCostingSheetAddLabourHoursInformationGateway.ClearBeforeFill = true;

            return rows;
        }