private MaterialsNavigatorTDS SubmitSearch()
        {
            // Retrieve clauses
            string whereClause = GetWhereClause();
            string orderByClause = "";
            string resourceType = hdfResourceType.Value.Trim();
            string conditionValue = "";
            int companyId = Int32.Parse(hdfCompanyId.Value.Trim());

            // ... Load data
            ResourceTypeViewConditionGateway resourceTypeViewConditionGateway = new ResourceTypeViewConditionGateway();
            resourceTypeViewConditionGateway.LoadByResourceTypeConditionId(resourceType, companyId, int.Parse(ddlCondition1.SelectedValue));

            conditionValue = resourceTypeViewConditionGateway.GetColumn_(resourceType, companyId, int.Parse(ddlCondition1.SelectedValue));

            MaterialsNavigator materialsNavigator = new MaterialsNavigator();
            materialsNavigator.Load(whereClause, orderByClause, conditionValue, tbxCondition1.Text.Trim(), companyId, resourceType);

            return (MaterialsNavigatorTDS)materialsNavigator.Data;
        }
        private void PostPageChanges()
        {
            MaterialsNavigator materialsNavigator = new MaterialsNavigator(materialsNavigatorTDS);

            // Update
            foreach (GridViewRow row in grdNavigator.Rows)
            {
                int materialId = Int32.Parse(((Label)row.FindControl("lblMaterialId")).Text.Trim());
                bool selected = ((CheckBox)row.FindControl("cbxSelected")).Checked;

                materialsNavigator.Update(materialId, selected);
            }

            materialsNavigator.Data.AcceptChanges();

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