private void UpdateDatabase()
        {
            DB.Open();
            DB.BeginTransaction();
            try
            {
                int companyId = Int32.Parse(hdfCompanyId.Value);
                int loginId = Convert.ToInt32(Session["loginID"]);

                if (cbxEndConfirm.Checked)
                {
                    ProjectCombinedCostingSheetAddBasicInformation projectCostingSheetAddBasicInformation = new ProjectCombinedCostingSheetAddBasicInformation(projectCostingSheetAddTDS);
                    int costingSheetId = projectCostingSheetAddBasicInformation.Save(companyId);
                    hdfCostingSheetId.Value = costingSheetId.ToString();

                    // Save costs information
                    ProjectCombinedCostingSheetAddLabourHoursInformation projectCostingSheetAddLabourHoursInformation = new ProjectCombinedCostingSheetAddLabourHoursInformation(projectCostingSheetAddTDS);
                    projectCostingSheetAddLabourHoursInformation.Save(companyId, costingSheetId);

                    ProjectCombinedCostingSheetAddUnitsInformation projectCostingSheetAddUnitsInformation = new ProjectCombinedCostingSheetAddUnitsInformation(projectCostingSheetAddTDS);
                    projectCostingSheetAddUnitsInformation.Save(companyId, costingSheetId);

                    ProjectCombinedCostingSheetAddMaterialsInformation projectCostingSheetAddMaterialsInformation = new ProjectCombinedCostingSheetAddMaterialsInformation(projectCostingSheetAddTDS);
                    projectCostingSheetAddMaterialsInformation.Save(companyId, costingSheetId);

                    ProjectCombinedCostingSheetAddSubcontractorsInformation projectCostingSheetAddSubcontractorsInformation = new ProjectCombinedCostingSheetAddSubcontractorsInformation(projectCostingSheetAddTDS);
                    projectCostingSheetAddSubcontractorsInformation.Save(companyId, costingSheetId);

                    ProjectCombinedCostingSheetAddOtherCostsInformation projectCostingSheetAddOtherCostsInformation = new ProjectCombinedCostingSheetAddOtherCostsInformation(projectCostingSheetAddTDS);
                    projectCostingSheetAddOtherCostsInformation.Save(companyId, costingSheetId);

                    ProjectCombinedCostingSheetAddRevenueInformation projectCostingSheetAddRevenueInformation = new ProjectCombinedCostingSheetAddRevenueInformation(projectCostingSheetAddTDS);
                    projectCostingSheetAddRevenueInformation.Save(companyId, costingSheetId);

                    if (rbtnBeginTemplate.Checked)
                    {
                        ProjectCostingSheetTemplateInformation projectCostingSheetTemplateInformation = new ProjectCostingSheetTemplateInformation(projectCostingSheetAddTDS);
                        projectCostingSheetTemplateInformation.Save(companyId);
                    }
                }
                else
                {
                    if (cbxEndSave.Checked)
                    {
                        ProjectCostingSheetTemplateInformation projectCostingSheetTemplateInformation = new ProjectCostingSheetTemplateInformation(projectCostingSheetAddTDS);
                        projectCostingSheetTemplateInformation.Save(companyId);
                    }
                    else
                    {
                        if (rbtnBeginTemplate.Checked)
                        {
                            ProjectCostingSheetTemplateInformation projectCostingSheetTemplateInformation = new ProjectCostingSheetTemplateInformation(projectCostingSheetAddTDS);
                            projectCostingSheetTemplateInformation.Save(companyId);
                        }
                    }
                }

                DB.CommitTransaction();

                // Store datasets
                projectCostingSheetAddTDS.AcceptChanges();
                Session["projectCostingSheetAddTDS"] = projectCostingSheetAddTDS;

            }
            catch (Exception ex)
            {
                DB.RollbackTransaction();

                string url = string.Format("./../../error_page.aspx?error={0}", ex.Message.Replace('\n', ' '));
                Response.Redirect(url);
            }
        }
        // ////////////////////////////////////////////////////////////////////////
        // STEP4 - LABOUR HOUR INFORMATION - METHODS
        //
        private void StepLabourHourInformationIn()
        {
            // Set instruction
            Label instruction = (Label)this.Master.FindControl("lblInstruction");
            instruction.Text = "Please verify Labour Hour information";

            int projectId = 0;

            // Load
            ProjectCombinedCostingSheetAddLabourHoursInformationGateway projectCombinedCostingSheetAddLabourHoursInformationGateway = new ProjectCombinedCostingSheetAddLabourHoursInformationGateway(projectCostingSheetAddTDS);

            projectCombinedCostingSheetAddLabourHoursInformationGateway.ClearBeforeFill = false;
            ProjectCombinedCostingSheetAddLabourHoursInformation model = new ProjectCombinedCostingSheetAddLabourHoursInformation(projectCombinedCostingSheetAddLabourHoursInformationGateway.Data);

            if (projectCostingSheetAddTDS.CombinedLabourHoursInformation.Rows.Count == 0)
            {
                foreach (int projectIdSelected in projectsSelected)
                {
                    projectId = projectIdSelected;

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

                    ArrayList works = new ArrayList();
                    if (cbxRehabAssessmentData.Checked) works.Add("Rehab Assessment");
                    if (cbxFullLengthLiningData.Checked) works.Add("Full Length");
                    if (cbxPointRepairData.Checked) { works.Add("Point Lining"); works.Add("Grouting"); }
                    if (cbxJunctionLiningData.Checked) works.Add("Junction Lining");
                    if (cbxManholeRehabData.Checked) works.Add("MH Rehab");
                    if (cbxMobilizationData.Checked) works.Add("Mobilization");
                    if (cbxOtherData.Checked)
                    {
                        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, tkrdpFrom.SelectedDate.Value, tkrdpTo.SelectedDate.Value, int.Parse(hdfCompanyId.Value), Int32.Parse(hdfClientId.Value));
                    }
                    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, tkrdpFrom.SelectedDate.Value, tkrdpTo.SelectedDate.Value, int.Parse(hdfCompanyId.Value), Int32.Parse(hdfClientId.Value));
                    }

                    projectCombinedCostingSheetAddLabourHoursInformationGateway.ClearBeforeFill = true;

                    // Store tables
                    Session.Remove("labourHoursInformationDummy");
                    labourHoursInformation = (ProjectCostingSheetAddTDS.CombinedLabourHoursInformationDataTable)model.Table;
                    Session["labourHoursInformation"] = labourHoursInformation;
                    Session["projectCostingSheetAddTDS"] = projectCostingSheetAddTDS;

                    grdTeamMembers.Columns[11].Visible = false;
                    grdTeamMembers.Columns[12].Visible = false;
                    grdTeamMembers.Columns[13].Visible = false;
                    grdTeamMembers.Columns[14].Visible = false;
                    grdTeamMembers.Columns[16].Visible = false;
                    grdTeamMembers.Columns[17].Visible = false;
                    grdTeamMembers.Columns[20].Visible = false;
                    grdTeamMembers.Columns[21].Visible = false;

                    // Validate grid columns
                    if (projectGateway.GetCountryID(projectId) == 1) //Canada
                    {
                        // Team Members Grid
                        grdTeamMembers.Columns[15].Visible = true;
                        grdTeamMembers.Columns[18].Visible = true;
                        grdTeamMembers.Columns[19].Visible = false;
                        grdTeamMembers.Columns[22].Visible = false;

                        // Totals
                        lblTeamMembersTotalCost.Text = "Total Cost (CAD) : ";
                        tbxTeamMembersTotalCostCAD.Visible = true;
                        tbxTeamMembersTotalCostUSD.Visible = false;
                    }
                    else
                    {
                        if (projectGateway.GetCountryID(projectId) == 2) //USA
                        {
                            // Team Members Grid
                            grdTeamMembers.Columns[15].Visible = false;
                            grdTeamMembers.Columns[18].Visible = false;
                            grdTeamMembers.Columns[19].Visible = true;
                            grdTeamMembers.Columns[22].Visible = true;

                            // Totals
                            lblTeamMembersTotalCost.Text = "Total Cost (USD) : ";
                            tbxTeamMembersTotalCostCAD.Visible = false;
                            tbxTeamMembersTotalCostUSD.Visible = true;
                        }
                    }
                }
            }

            grdTeamMembers.DataBind();
            StepLabourHoursInformationProcessGrid();
        }
        protected void grdTeamMembers_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            // Team member Gridview, if the gridview is edition mode
            if (grdTeamMembers.EditIndex >= 0)
            {
                grdTeamMembers.UpdateRow(grdTeamMembers.EditIndex, true);
            }

            // Add New Team Member
            int costingSheetId = (int)e.Keys["CostingSheetID"];
            string work_ = (string)e.Keys["Work_"];
            int employeeId = (int)e.Keys["EmployeeID"];
            int refId = (int)e.Keys["RefID"];

            ProjectCombinedCostingSheetAddLabourHoursInformation model = new ProjectCombinedCostingSheetAddLabourHoursInformation(projectCostingSheetAddTDS);

            // Delete Team Member Cost
            model.Delete(costingSheetId, work_, employeeId, refId);

            // Store dataset
            labourHoursInformation = (ProjectCostingSheetAddTDS.CombinedLabourHoursInformationDataTable)model.Table;
            Session["labourHoursInformation"] = labourHoursInformation;
            Session["projectCostingSheetAddTDS"] = projectCostingSheetAddTDS;

            StepLabourHoursInformationProcessGrid();
        }
        protected void grdTeamMembers_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            int projectId = 0;

            foreach (int projectIdSelected in projectsSelected)
            {
                projectId = projectIdSelected;
            }

            ProjectGateway projectGateway = new ProjectGateway();

            // Validate general data
            Page.Validate("labourHoursEdit");

            if (Page.IsValid)
            {
                projectGateway.LoadByProjectId(projectId);

                // Validate costs
                if (projectGateway.GetCountryID(projectId) == 1) //Canada
                {
                    Page.Validate("labourHoursCadEdit");
                }
                else
                {
                    Page.Validate("labourHoursUsdEdit");
                }
            }

            if (Page.IsValid)
            {
                int costingSheetId = (int)e.Keys["CostingSheetID"];
                string work_ = (string)e.Keys["Work_"];
                int employeeId = (int)e.Keys["EmployeeID"];
                int refId = (int)e.Keys["RefID"];
                int companyId = Int32.Parse(hdfCompanyId.Value);

                string name = ((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxTeamMemberEdit")).Text;
                string unitOfMeasurementLH = ((DropDownList)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("ddlUnitOfMeasurementLHEdit")).SelectedValue;
                double lHQuantity = double.Parse(((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxLHQtyEdit")).Text.Trim());
                string unitOfMeasurementMeals = ((DropDownList)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("ddlUnitsOfMeasurementLHMealsEdit")).SelectedValue;
                int? mealsQuantity = null; if (((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMealsQtyEdit")).Text.Trim() != "") mealsQuantity = Int32.Parse(((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMealsQtyEdit")).Text.Trim());
                string unitOfMeasurementMotel = ((DropDownList)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("ddlUnitsOfMeasurementLHMotelEdit")).SelectedValue;
                int? motelQuantity = null; if (((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMotelQtyEdit")).Text.Trim() != "") motelQuantity = Int32.Parse(((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMotelQtyEdit")).Text.Trim());

                decimal lhCostCad = 0.0M;
                decimal totalCostCad = 0.0M;
                decimal? mealsCostCad = null;
                decimal? motelCostCad = null;
                decimal lhCostUsd = 0.0M;
                decimal totalCostUsd = 0.0M;
                decimal? mealsCostUsd = null;
                decimal? motelCostUsd = null;

                if (projectGateway.GetCountryID(projectId) == 1) //Canada
                {
                    lhCostCad = Decimal.Parse(((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxLHCostCADEdit")).Text.Trim());
                    if (((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMealsCostCADEdit")).Text.Trim() != "") mealsCostCad = Decimal.Parse(((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMealsCostCADEdit")).Text.Trim());
                    if (((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMotelCostCADEdit")).Text.Trim() != "") motelCostCad = Decimal.Parse(((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMotelCostCADEdit")).Text.Trim());
                    totalCostCad = (lhCostCad * decimal.Parse(lHQuantity.ToString()));
                    if (mealsCostCad.HasValue && mealsQuantity.HasValue) totalCostCad = totalCostCad + (mealsCostCad.Value * decimal.Parse(mealsQuantity.Value.ToString()));
                    if (motelCostCad.HasValue && motelQuantity.HasValue) totalCostCad = totalCostCad + (motelCostCad.Value * decimal.Parse(motelQuantity.Value.ToString()));
                    totalCostCad = Decimal.Round(totalCostCad, 2);
                }
                else
                {
                    lhCostUsd = Decimal.Parse(((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxLHCostUSDEdit")).Text.Trim());
                    if (((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMealsCostUSDEdit")).Text.Trim() != "") mealsCostUsd = Decimal.Parse(((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMealsCostUSDEdit")).Text.Trim());
                    if (((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMotelCostUSDEdit")).Text.Trim() != "") motelCostUsd = Decimal.Parse(((TextBox)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tbxMotelCostUSDEdit")).Text.Trim());
                    totalCostUsd = (lhCostUsd * decimal.Parse(lHQuantity.ToString()));
                    if (mealsCostUsd.HasValue && mealsQuantity.HasValue) totalCostUsd = totalCostUsd + (mealsCostUsd.Value * decimal.Parse(mealsQuantity.Value.ToString()));
                    if (motelCostUsd.HasValue && motelQuantity.HasValue) totalCostUsd = totalCostUsd + (motelCostUsd.Value * decimal.Parse(motelQuantity.Value.ToString()));
                    totalCostUsd = Decimal.Round(totalCostUsd, 2);
                }

                DateTime startDate = ((RadDatePicker)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tkrdpStartDateEdit")).SelectedDate.Value;
                DateTime endDate = ((RadDatePicker)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("tkrdpEndDateEdit")).SelectedDate.Value;

                string workFunctionConcat = "";
                string function_ = "";
                workFunctionConcat = ((DropDownList)grdTeamMembers.Rows[e.RowIndex].Cells[0].FindControl("ddlWorkFunctionEdit")).SelectedValue;
                if (workFunctionConcat != "(Select)")
                {
                    string[] workFunction = workFunctionConcat.ToString().Trim().Split('.');
                    function_ = workFunction[1].Trim();
                }

                // Update data
                ProjectCombinedCostingSheetAddLabourHoursInformation model = new ProjectCombinedCostingSheetAddLabourHoursInformation(projectCostingSheetAddTDS);
                model.Update(costingSheetId, work_, employeeId, refId, lHQuantity, unitOfMeasurementLH, unitOfMeasurementMeals, mealsQuantity, unitOfMeasurementMotel, motelQuantity, lhCostCad, mealsCostCad, motelCostCad, totalCostCad, lhCostUsd, mealsCostUsd, motelCostUsd, totalCostUsd, false, companyId, name, startDate, endDate, workFunctionConcat, function_);

                // Store dataset
                labourHoursInformation = (ProjectCostingSheetAddTDS.CombinedLabourHoursInformationDataTable)model.Table;
                Session["labourHoursInformation"] = labourHoursInformation;
                Session["projectCostingSheetAddTDS"] = projectCostingSheetAddTDS;

                StepLabourHoursInformationProcessGrid();
            }
            else
            {
                e.Cancel = true;
            }
        }
        // /////////////////////////////////////////////////////////////////////////////////////////////////////
        //
        // STEP4 - LABOUR HOUR INFORMATION
        //
        // ////////////////////////////////////////////////////////////////////////
        // STEP4 - LABOUR HOUR INFORMATION - EVENTS
        //
        protected void grdTeamMembers_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
                case "Add":
                    // Team member Gridview, if the gridview is edition mode
                    if (grdTeamMembers.EditIndex >= 0)
                    {
                        grdTeamMembers.UpdateRow(grdTeamMembers.EditIndex, true);
                    }

                    // Add New Team Member
                    int projectId = 0;

                    foreach (int projectIdSelected in projectsSelected)
                    {
                        projectId = projectIdSelected;
                    }

                    ProjectGateway projectGateway = new ProjectGateway();

                    // Validate general data
                    Page.Validate("labourHoursNew");

                    if (Page.IsValid)
                    {
                        projectGateway.LoadByProjectId(projectId);

                        // Validate costs
                        if (projectGateway.GetCountryID(projectId) == 1) //Canada
                        {
                            Page.Validate("labourHoursCadNew");
                        }
                        else
                        {
                            Page.Validate("labourHoursUsdNew");
                        }
                    }

                    if (Page.IsValid)
                    {
                        int companyId = Int32.Parse(hdfCompanyId.Value);
                        string typeOfWork = ((DropDownList)grdTeamMembers.FooterRow.FindControl("ddlTypeOfWork_New")).SelectedValue;
                        int employeeId = Int32.Parse(((DropDownList)grdTeamMembers.FooterRow.FindControl("ddlTeamMemberNew")).SelectedValue);
                        string name = ((DropDownList)grdTeamMembers.FooterRow.FindControl("ddlTeamMemberNew")).SelectedItem.Text;
                        string unitOfMeasurementLH = ((DropDownList)grdTeamMembers.FooterRow.FindControl("ddlUnitOfMeasurementLHNew")).SelectedValue;
                        double lHQuantity = double.Parse(((TextBox)grdTeamMembers.FooterRow.FindControl("tbxLHQtyNew")).Text.Trim());
                        string unitOfMeasurementMeals = ((DropDownList)grdTeamMembers.FooterRow.FindControl("ddlUnitsOfMeasurementLHMealsNew")).SelectedValue;
                        int? mealsQuantity = null; if (((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMealsQtyNew")).Text.Trim() != "") mealsQuantity = Int32.Parse(((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMealsQtyNew")).Text.Trim());
                        string unitOfMeasurementMotel = ((DropDownList)grdTeamMembers.FooterRow.FindControl("ddlUnitsOfMeasurementLHMotelNew")).SelectedValue;
                        int? motelQuantity = null; if (((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMotelQtyNew")).Text.Trim() != "") motelQuantity = Int32.Parse(((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMotelQtyNew")).Text.Trim());

                        decimal lhCostCad = 0.0M;
                        decimal totalCostCad = 0.0M;
                        decimal? mealsCostCad = null;
                        decimal? motelCostCad = null;
                        decimal lhCostUsd = 0.0M;
                        decimal totalCostUsd = 0.0M;
                        decimal? mealsCostUsd = null;
                        decimal? motelCostUsd = null;

                        if (projectGateway.GetCountryID(projectId) == 1) //Canada
                        {
                            lhCostCad = Decimal.Parse(((TextBox)grdTeamMembers.FooterRow.FindControl("tbxLHCostCADNew")).Text.Trim());
                            if (((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMealsCostCADNew")).Text.Trim() != "") mealsCostCad = Decimal.Parse(((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMealsCostCADNew")).Text.Trim());
                            if (((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMotelCostCADNew")).Text.Trim() != "") motelCostCad = Decimal.Parse(((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMotelCostCADNew")).Text.Trim());
                            totalCostCad = (lhCostCad * decimal.Parse(lHQuantity.ToString()));
                            if (mealsCostCad.HasValue && mealsQuantity.HasValue) totalCostCad = totalCostCad + (mealsCostCad.Value * decimal.Parse(mealsQuantity.Value.ToString()));
                            if (motelCostCad.HasValue && motelQuantity.HasValue) totalCostCad = totalCostCad + (motelCostCad.Value * decimal.Parse(motelQuantity.Value.ToString()));
                            totalCostCad = Decimal.Round(totalCostCad, 2);
                        }
                        else
                        {
                            lhCostUsd = Decimal.Parse(((TextBox)grdTeamMembers.FooterRow.FindControl("tbxLHCostUSDNew")).Text.Trim());
                            if (((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMealsCostUSDNew")).Text.Trim() != "") mealsCostUsd = Decimal.Parse(((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMealsCostUSDNew")).Text.Trim());
                            if (((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMotelCostUSDNew")).Text.Trim() != "") motelCostUsd = Decimal.Parse(((TextBox)grdTeamMembers.FooterRow.FindControl("tbxMotelCostUSDNew")).Text.Trim());
                            totalCostUsd = (lhCostUsd * decimal.Parse(lHQuantity.ToString()));
                            if (mealsCostUsd.HasValue && mealsQuantity.HasValue) totalCostUsd = totalCostUsd + (mealsCostUsd.Value * decimal.Parse(mealsQuantity.Value.ToString()));
                            if (motelCostUsd.HasValue && motelQuantity.HasValue) totalCostUsd = totalCostUsd + (motelCostUsd.Value * decimal.Parse(motelQuantity.Value.ToString()));
                            totalCostUsd = Decimal.Round(totalCostUsd, 2);
                        }

                        DateTime startDate = ((RadDatePicker)grdTeamMembers.FooterRow.FindControl("tkrdpStartDateNew")).SelectedDate.Value;
                        DateTime endDate = ((RadDatePicker)grdTeamMembers.FooterRow.FindControl("tkrdpEndDateNew")).SelectedDate.Value;

                        string workFunctionConcat = "";
                        string function_ = "";
                        workFunctionConcat = ((DropDownList)grdTeamMembers.FooterRow.FindControl("ddlWorkFunctionNew")).SelectedValue;
                        if (workFunctionConcat != "(Select)")
                        {
                            string[] workFunction = workFunctionConcat.ToString().Trim().Split('.');
                            function_ = workFunction[1].Trim();
                        }

                        ProjectCombinedCostingSheetAddLabourHoursInformation model = new ProjectCombinedCostingSheetAddLabourHoursInformation(projectCostingSheetAddTDS);
                        model.Insert(0, typeOfWork, employeeId, lHQuantity, unitOfMeasurementLH, unitOfMeasurementMeals, mealsQuantity, unitOfMeasurementMotel, motelQuantity, lhCostCad, mealsCostCad, motelCostCad, totalCostCad, lhCostUsd, mealsCostUsd, motelCostUsd, totalCostUsd, false, companyId, name, startDate, endDate, workFunctionConcat, function_, Int32.Parse(hdfClientId.Value), 1);

                        Session.Remove("labourHoursInformationDummy");
                        labourHoursInformation = (ProjectCostingSheetAddTDS.CombinedLabourHoursInformationDataTable)model.Table;
                        Session["labourHoursInformation"] = labourHoursInformation;
                        Session["projectCostingSheetAddTDS"] = projectCostingSheetAddTDS;

                        grdTeamMembers.DataBind();
                        StepLabourHoursInformationProcessGrid();
                    }
                    break;
            }
        }