private RaNavigatorTDS SubmitSearch()
        {
            // Retrieve clauses
            string whereClause = GetWhereClause();
            string orderByClause = GetOrderByClause();
            string workType = hdfWorkType.Value.Trim();
            string conditionValue = "";
            int companyId = Int32.Parse(hdfCompanyId.Value.Trim());
            int currentProjectId = Int32.Parse(hdfCurrentProjectId.Value.Trim());
            RaNavigator raNavigator = new RaNavigator();

            // ... Load data
            WorkTypeViewConditionGateway workTypeViewConditionGateway = new WorkTypeViewConditionGateway();
            workTypeViewConditionGateway.LoadByWorkTypeConditionId(workType, int.Parse(ddlCondition1.SelectedValue), companyId);

            conditionValue = workTypeViewConditionGateway.GetColumn_(workType, companyId, int.Parse(ddlCondition1.SelectedValue));

            raNavigator.Load(whereClause, orderByClause, conditionValue, tbxCondition1.Text.Trim(), companyId, currentProjectId, workType);

            return (RaNavigatorTDS)raNavigator.Data;
        }
        private RaNavigatorTDS SubmitSearchForViews()
        {
            string sqlCommand = "";
            int viewId = Int32.Parse(ddlView.SelectedValue.Trim());

            RaNavigator raNavigator = new RaNavigator();
            string workType = hdfWorkType.Value.Trim();
            int companyId = Int32.Parse(hdfCompanyId.Value.Trim());
            int currentProjectId = Int32.Parse(hdfCurrentProjectId.Value.Trim());

            // ... Load SqlCommand
            WorkViewGateway workViewGateway = new WorkViewGateway();
            workViewGateway.LoadByViewId(viewId, companyId);

            sqlCommand = workViewGateway.GetSqlCommand(viewId);

            // ... Load data
            raNavigator.LoadForViewsProjectIdCompanyIdWorkType(sqlCommand, currentProjectId, companyId, workType);

            return (RaNavigatorTDS)raNavigator.Data;
        }
        private void PostPageChanges()
        {
            RaNavigator raNavigator = new RaNavigator(raNavigatorTDS);

            // Update grid rows
            foreach (GridViewRow row in grdRANavigator.Rows)
            {
                string assetIdLabel = ((Label)row.FindControl("lblAssetId")).Text.Trim();
                int assetId = Int32.Parse(assetIdLabel.ToString().Trim());
                bool selected = ((CheckBox)row.FindControl("cbxSelected")).Checked;

                raNavigator.Update(assetId, selected);
            }

            raNavigator.Data.AcceptChanges();

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