private int PostPageChangesInsurance()
        {
            int selectedRows = 0;

            if (pnlInsuranceGrid.Visible)
            {
                ActualCostsNavigatorInsuranceCompaniesCosts actualCostsNavigatorInsuranceCompaniesCosts = new ActualCostsNavigatorInsuranceCompaniesCosts(actualCostsNavigatorTDS);

                if (actualCostsNavigatorInsuranceCompaniesCosts.Table.Rows.Count > 0)
                {
                    foreach (GridViewRow row in grdInsuranceNavigator.Rows)
                    {
                        if (((CheckBox)row.FindControl("cbxInsuranceSelected")).Checked)
                        {
                            int insuranceCompanyId = Int32.Parse(((Label)row.FindControl("lblInsuranceCompanyID")).Text.Trim());
                            int projectId = Int32.Parse(((Label)row.FindControl("lblInsuranceProjectID")).Text.Trim());
                            int refId = Int32.Parse(((Label)row.FindControl("lblInsuranceRefID")).Text.Trim());
                            bool selected = ((CheckBox)row.FindControl("cbxInsuranceSelected")).Checked;
                            tableCategory = "Insurance";
                            selectedRows = selectedRows + 1;

                            actualCostsNavigatorInsuranceCompaniesCosts.Update(projectId, refId, selected);
                        }
                    }

                    actualCostsNavigatorInsuranceCompaniesCosts.Data.AcceptChanges();

                    // Store datasets
                    Session["actualCostsNavigatorTDS"] = actualCostsNavigatorTDS;
                }
            }

            return selectedRows;
        }
        private void LoadByInsurance(int projectId, int clientId, string textForSearch, ActualCostsNavigatorTDS actualCostsNavigatorTDSForSearch, int insuranceCompanyId)
        {
            string whereClause = GetWhereClauseForInsurance(insuranceCompanyId, projectId, clientId, textForSearch);
            string orderByClause = GetOrderByClause();

            ActualCostsNavigatorInsuranceCompaniesCosts actualCostsNavigatorInsuranceCompaniesCosts = new ActualCostsNavigatorInsuranceCompaniesCosts(actualCostsNavigatorTDSForSearch);
            actualCostsNavigatorInsuranceCompaniesCosts.Load(whereClause, orderByClause);
        }