protected void grdPointRepairs_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            Page.Validate("repairsEdit");
            if (Page.IsValid)
            {
                Guid id = new Guid(((Label)grdPointRepairs.Rows[e.RowIndex].Cells[0].FindControl("lblId")).Text);
                int refId = Int32.Parse(((Label)grdPointRepairs.Rows[e.RowIndex].Cells[1].FindControl("lblRefId")).Text);
                int companyId = Int32.Parse(((Label)grdPointRepairs.Rows[e.RowIndex].Cells[2].FindControl("lblCOMPANY_ID")).Text);

                string linerDistance = ((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("tbxLinerDistanceEdit")).Text.Trim();
                string direction = ((DropDownList)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("ddlDirectionEdit")).SelectedValue;
                int? reinstates = null; if (((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("tbxReinstatesEdit")).Text != "") reinstates = Int32.Parse(((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("tbxReinstatesEdit")).Text);
                string ltMh = ((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("tbxLtMhEdit")).Text.Trim();
                string vtMh = ((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("tbxVtMhEdit")).Text.Trim();
                DateTime? installDate = null; if (((RadDatePicker)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("tkrdpInstallDateEdit")).SelectedDate.HasValue) installDate = ((RadDatePicker)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("tkrdpInstallDateEdit")).SelectedDate.Value;
                string distance = ((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("tbxDistanceEdit")).Text.Trim();
                string size = ((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("tbxSizeEdit")).Text.Trim();
                string mhShot = ((DropDownList)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("ddlMhShotEdit")).SelectedValue;
                bool extraRepair = ((CheckBox)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("ckbxExptraRepairEdit")).Checked;
                bool cancelled = ((CheckBox)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("ckbxCancelledEdit")).Checked;
                bool approved = ((CheckBox)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("ckbxApprovedEdit")).Checked;
                bool notApproved = ((CheckBox)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("ckbxNotApprovedEdit")).Checked;

                AddRecordPointRepairs model = new AddRecordPointRepairs(addRecordTDS);
                model.Update(id, refId, companyId, linerDistance, direction, reinstates, ltMh, vtMh, installDate, distance, size, mhShot, extraRepair, cancelled, approved, notApproved);

                Session["addRecordTDS"] = addRecordTDS;
            }
            else
            {
                e.Cancel = true;
            }
        }
        protected void grdPointRepairs_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            Page.Validate("repairsEdit");
            if (Page.IsValid)
            {
                Guid id = new Guid(((Label)grdPointRepairs.Rows[e.RowIndex].Cells[0].FindControl("lblId")).Text.Trim());
                int refId = Int32.Parse(((Label)grdPointRepairs.Rows[e.RowIndex].Cells[1].FindControl("lblRefId")).Text.Trim());
                int companyId = Int32.Parse(((Label)grdPointRepairs.Rows[e.RowIndex].Cells[3].FindControl("lblCOMPANY_ID")).Text.Trim());

                string repairSize = ((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[6].FindControl("tbxRepairSizeEdit")).Text.Trim();
                DateTime? installDate = null; if (((RadDatePicker)grdPointRepairs.Rows[e.RowIndex].Cells[8].FindControl("tkrdpInstallDateEdit")).SelectedDate.HasValue) installDate = ((RadDatePicker)grdPointRepairs.Rows[e.RowIndex].Cells[8].FindControl("tkrdpInstallDateEdit")).SelectedDate.Value;
                string distance = ((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[5].FindControl("tbxDistanceEdit")).Text.Trim();
                decimal? cost = null; if (((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[9].FindControl("tbxCostEdit")).Text.Trim() != "") cost = Decimal.Parse(((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[9].FindControl("tbxCostEdit")).Text.Trim());
                int? reinstates = null; if (((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[7].FindControl("tbxReinstatesEdit")).Text.Trim() != "") reinstates = Int32.Parse(((TextBox)grdPointRepairs.Rows[e.RowIndex].Cells[7].FindControl("tbxReinstatesEdit")).Text.Trim());

                AddRecordPointRepairs model = new AddRecordPointRepairs(addRecordTDS);
                model.Update(id, refId, companyId, repairSize, installDate, distance, cost, reinstates);

                Session["addRecordTDS"] = addRecordTDS;
            }
            else
            {
                e.Cancel = true;
            }
        }