private void LoadFundingGrid(string sortExpr) { //ProjectFundingSource biz = new ProjectFundingSource(); DataView view; //if (projectId != -1) // biz.GetByParent(projectId); //else // biz.GetAll(); if (projectId != -1) { view = BusinessObject.GetByParentAsDataView <ProjectFundingSource>(projectId); } else { view = BusinessObject.GetAllAsDataView <ProjectFundingSource>(); } //biz.DataSourceView.Sort = sortExpr; view.Sort = sortExpr; //if (biz.DataSourceView.Table.Rows.Count == 0) if (view.Count == 0) { EmptyMessageLabel.Visible = true; } else { EmptyMessageLabel.Visible = false; //FundingGrid.DataSource = biz.DataSourceView; FundingGrid.DataSource = view; FundingGrid.DataBind(); } }
/// <summary> /// Sorts Organizations based on column selected in header. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void HandleHeaderSortClick(object sender, CommandEventArgs e) { LinkButton btn = sender as LinkButton; string sortExpr = e.CommandArgument.ToString(); SortDirection sortDir = GridViewSortDirection == String.Empty || GridViewSortDirection == "ASC" ? SortDirection.Descending : SortDirection.Ascending; FundingGrid.Sort(sortExpr, sortDir); }
/// <summary> /// Binds the various summary info grids /// </summary> /// <param name="projectId"></param> protected void BindGrids(int projectId) { ProjectManagementDa da = new ProjectManagementDa(); OrganizationsGrid.DataSource = da.GetAllOrganizationsSortedByProjectId(projectId); OrganizationsGrid.DataBind(); ContactsGrid.DataSource = da.GetProjectContactsByProjectId(projectId); ContactsGrid.DataBind(); //BusinessObject.ProjectManuscript bizMan = new BusinessObject.ProjectManuscript(); //bizMan.GetByParent(projectId); //ManuscriptGrid.DataSource = bizMan.DataSourceView; ManuscriptGrid.DataSource = BusinessObject.GetByParentAsDataView <BOL.ProjectManuscript>(projectId); ManuscriptGrid.DataBind(); //ProjectFundingSource biz = new ProjectFundingSource(); //biz.GetByParent(projectId); //FundingGrid.DataSource = biz.DataSourceView; FundingGrid.DataSource = BusinessObject.GetByParentAsDataView <ProjectFundingSource>(projectId); FundingGrid.DataBind(); }