/// <summary> /// Binds the GridViews with data from the database. /// </summary> protected void ShowData() { PendingRulesGridView.DataSource = GlobalState.rules.PrintPendingRules(); PendingRulesGridView.DataBind(); ApprovedRulesGridView.DataSource = GlobalState.rules.PrintApprovedRules(); ApprovedRulesGridView.DataBind(); RejectedRulesGridView.DataSource = GlobalState.rules.PrintRejectedRules(); RejectedRulesGridView.DataBind(); }
// Binds data to tables in Rules Report screen protected void ShowData() { double approvedCount = GlobalState.rules.CountApproved(); double rejectedCount = GlobalState.rules.CountRejected(); DataTable approvedRulesList = GlobalState.rules.PrintApprovedRules(); Dictionary <string, string> ruleStatistics = new Dictionary <string, string> { { "Count of Approved", approvedCount.ToString("N0") }, { "Count of Rejected", rejectedCount.ToString("N0") }, { "Success Rate", (approvedCount / (approvedCount + rejectedCount) * 100).ToString("N0") + "%" } }; ApprovedRulesGridView.DataSource = approvedRulesList; ApprovedRulesGridView.DataBind(); RulesStatisticsGridView.DataSource = ruleStatistics; RulesStatisticsGridView.DataBind(); }