private int PostPageChangesSubcontractor()
        {
            int selectedRows = 0;

            // Update subcontractors
            if (pnlGrid.Visible)
            {
                ActualCostsNavigatorSubcontractorCosts actualCostsNavigatorSubcontractorCosts = new ActualCostsNavigatorSubcontractorCosts(actualCostsNavigatorTDS);
                if (actualCostsNavigatorSubcontractorCosts.Table.Rows.Count > 0)
                {
                    foreach (GridViewRow row in grdSubcontractorNavigator.Rows)
                    {
                        if (((CheckBox)row.FindControl("cbxSelected")).Checked)
                        {
                            int projectId = Int32.Parse(((Label)row.FindControl("lblProjectID")).Text.Trim());
                            int refId = Int32.Parse(((Label)row.FindControl("lblRefIDID")).Text.Trim());
                            bool selected = ((CheckBox)row.FindControl("cbxSelected")).Checked;
                            tableCategory = "Subcontractors";
                            selectedRows = selectedRows + 1;

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

                    actualCostsNavigatorSubcontractorCosts.Data.AcceptChanges();

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

            return selectedRows;
        }
        private void LoadBySubcontractor(int projectId, int clientId, string textForSearch, ActualCostsNavigatorTDS actualCostsNavigatorTDSForSearch, int subcontractorId)
        {
            string whereClause = GetWhereClauseForSubcontractor(subcontractorId, projectId, clientId, textForSearch);
            string orderByClause = GetOrderByClause();

            ActualCostsNavigatorSubcontractorCosts actualCostsNavigatorSubcontractorCosts = new ActualCostsNavigatorSubcontractorCosts(actualCostsNavigatorTDSForSearch);
            actualCostsNavigatorSubcontractorCosts.Load(whereClause, orderByClause);
        }