protected void gvNominees_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { for (int i = 0; i < e.Row.Cells.Count; i++) { DataControlFieldHeaderCell obj = (DataControlFieldHeaderCell)e.Row.Cells[i]; if (!String.IsNullOrEmpty(this.SortColumn) && obj.ContainingField.SortExpression == this.SortColumn) { GridHelper.AddSortImage(obj, SortDirection); } } } if (e.Row.RowType == DataControlRowType.DataRow) { Portfolio app = e.Row.DataItem as Portfolio; if (e.Row.RowState == DataControlRowState.Edit) { DropDownList ddlEditStatus = e.Row.FindControl("ddlEditStatus") as DropDownList; ddlEditStatus.SelectedValue = app.Status.ToString(); } else { Label labStatus = e.Row.FindControl("labStatus") as Label; if (null != labStatus) { labStatus.Text = app.Status.ToDescription(); } } ListView lv = e.Row.FindControl("lvScores") as ListView; lv.DataSource = ScoreService.GetJudgeStatusForPortfolio(app); lv.DataBind(); } }
protected void gvNominees_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { for (int i = 0; i < e.Row.Cells.Count; i++) { DataControlFieldHeaderCell obj = (DataControlFieldHeaderCell)e.Row.Cells[i]; if (!String.IsNullOrEmpty(this.SortColumn) && obj.ContainingField.SortExpression == this.SortColumn) { GridHelper.AddSortImage(obj, SortDirection); } } } if (e.Row.RowType == DataControlRowType.DataRow) { JudgeStatus js = e.Row.DataItem as JudgeStatus; if (null != js) { Label labStatus = e.Row.FindControl("labStatus") as Label; Label labScore = e.Row.FindControl("labScore") as Label; Label labTotalScore = e.Row.FindControl("labTotalScore") as Label; Label labRanking = e.Row.FindControl("labRanking") as Label; HyperLink btnScores = e.Row.FindControl("btnScores") as HyperLink; labStatus.Text = js.Phase.ToDescription(); labScore.Text = js.Score.ToString("F"); labTotalScore.Text = js.Portfolio.TotalScore.ToString("F"); labRanking.Text = js.Portfolio.Ranking.ToString(); if (js.Score == 0) { labScore.ForeColor = System.Drawing.Color.Red; } else { //labStatus.Text = js.Application.Status.ToDescription(); labScore.Text = ScoreService.ComputeScore(Judge, js.Portfolio).ToString("F"); } //labScore.Attributes.Add("onmouseover", "tooltip.show('" + GetOtherScores(js.Application) + "');"); //labScore.Attributes.Add("onmouseout", "tooltip.hide();"); btnScores.Visible = !js.Submitted; } } }
protected void gvNominees_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { for (int i = 0; i < e.Row.Cells.Count; i++) { DataControlFieldHeaderCell obj = (DataControlFieldHeaderCell)e.Row.Cells[i]; if (!String.IsNullOrEmpty(this.SortColumn) && obj.ContainingField.SortExpression == this.SortColumn) { GridHelper.AddSortImage(obj, SortDirection); } } } if (e.Row.RowType == DataControlRowType.DataRow) { Portfolio app = e.Row.DataItem as Portfolio; Label labStatus = e.Row.FindControl("labStatus") as Label; if (null != labStatus) { labStatus.Text = app.Status.ToDescription(); } } }
protected void gvUsers_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { for (int i = 0; i < e.Row.Cells.Count; i++) { DataControlFieldHeaderCell obj = (DataControlFieldHeaderCell)e.Row.Cells[i]; if (!String.IsNullOrEmpty(this.SortColumn) && obj.ContainingField.SortExpression == this.SortColumn) { GridHelper.AddSortImage(obj, SortDirection); } } } if (e.Row.RowType == DataControlRowType.DataRow) { DisplayUser ds = e.Row.DataItem as DisplayUser; if (null != ds) { Label labStatus = e.Row.FindControl("labStatus") as Label; LinkButton btnDelete = e.Row.FindControl("btnDelete") as LinkButton; LinkButton btnStatus = e.Row.FindControl("btnStatus") as LinkButton; LinkButton btnUnlock = e.Row.FindControl("btnUnlock") as LinkButton; btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this user?');"); if (null != ds.Status) { labStatus.Text = ((Status)Enum.ToObject(typeof(Status), ds.Status)).ToDescription(); } if (ds.Disabled) { btnStatus.Text = "Enable"; } else { btnStatus.Text = "Disable"; } btnUnlock.Visible = false; HyperLink btnView = e.Row.FindControl("btnView") as HyperLink; User u = UserService.GetUser(ds.Id); if (UserService.IsAccountLocked(u)) { btnUnlock.Visible = true; } if (ds.Role == RoleType.Nominee) { Portfolio portfolio = PortfolioService.GetPortfolioByUser(u); if (null != portfolio) { btnView.NavigateUrl = "~/ReportView.aspx?report=profile&id=" + portfolio.Id.ToString(); } } else if (ds.Role == RoleType.AreaJudge || ds.Role == RoleType.RegionJudge) { btnView.Text = "Create Scores"; btnView.NavigateUrl = "~/Admin/BuildScores.aspx?id=" + ds.Id.ToString(); } else { btnView.Visible = false; } } } }