protected void grdUnits_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            // Validate general data
            Page.Validate("unitsEdit");
            int projectId = Int32.Parse(hdfProjectId.Value);
            ProjectGateway projectGateway = new ProjectGateway();

            if (Page.IsValid)
            {
                // Validate costs
                projectGateway.LoadByProjectId(projectId);

                if (projectGateway.GetCountryID(projectId) == 1) //Canada
                {
                    Page.Validate("unitsCadEdit");
                }
                else
                {
                    Page.Validate("unitsUsdEdit");
                }
            }

            if (Page.IsValid)
            {
                int costingSheetId = (int)e.Keys["CostingSheetID"];
                string work_ = (string)e.Keys["Work_"];
                int unitId = (int)e.Keys["UnitID"];
                int refId = (int)e.Keys["RefID"];

                int companyId = Int32.Parse(hdfCompanyId.Value);
                string unitOfMeasurement = ((DropDownList)grdUnits.Rows[e.RowIndex].Cells[0].FindControl("ddlUnitOfMeasurementUnitsEdit")).SelectedValue;
                double quantity = double.Parse(((TextBox)grdUnits.Rows[e.RowIndex].Cells[0].FindControl("tbxQuantityEdit")).Text.Trim());

                decimal costCad = 0.0M;
                decimal totalCostCad = 0.0M;
                decimal costUsd = 0.0M;
                decimal totalCostUsd = 0.0M;

                if (projectGateway.GetCountryID(projectId) == 1) //Canada
                {
                    costCad = Decimal.Parse(((TextBox)grdUnits.Rows[e.RowIndex].Cells[0].FindControl("tbxCostCADEdit")).Text.Trim());
                    totalCostCad = (costCad * decimal.Parse(quantity.ToString()));
                    totalCostCad = Decimal.Round(totalCostCad, 2);
                }
                else
                {
                    costUsd = Decimal.Parse(((TextBox)grdUnits.Rows[e.RowIndex].Cells[0].FindControl("tbxCostUSDEdit")).Text.Trim());
                    totalCostUsd = (costUsd * decimal.Parse(quantity.ToString()));
                    totalCostUsd = Decimal.Round(totalCostUsd, 2);
                }

                LFSLive.DA.FleetManagement.Units.UnitsGateway u = new LiquiForce.LFSLive.DA.FleetManagement.Units.UnitsGateway();
                u.LoadByUnitId(unitId, companyId);
                string unitDescription = u.GetDescription(unitId);
                string unitCode = u.GetUnitCode(unitId);

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

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

                // Update data
                ProjectCostingSheetAddUnitsInformation model = new ProjectCostingSheetAddUnitsInformation(projectCostingSheetAddTDS);
                model.Update(costingSheetId, work_, unitId, refId, unitOfMeasurement, quantity, costCad, totalCostCad, costUsd, totalCostUsd, false, companyId, unitCode, unitDescription, startDate, endDate, workFunctionConcat, function_);

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

                StepTrucksEquipmentInformationProcessGrid();
            }
            else
            {
                e.Cancel = true;
            }
        }