Code Behind Page Page /Controls/ResultsView.ascx.cs (C#)
Used by Page /Controls/ResultsView.ascx (C#)
1: using System;
2: using System.Data;
3: using System.Text;
4: using System.Web.UI;
5: using System.Web.UI.WebControls;
6: using Microsoft.ApplicationBlocks.Data;
7: using QuizNetOnline.Logic;
8:
9: namespace QuiznetOnline.Web.UI.Controls
10: {
11: public enum Topics
12: {
13: csharp = 0,
14: aspnet = 1,
15: netframework = 2,
16: sql = 3,
17: all = 4
18: }
19:
20: public partial class ResultsView : UserControl
21: {
22: public bool IspanelLoadQuizVisible
23: {
24: get { return NumberOfQuestionsPerTopic.IspanelLoadQuizVisible; }
25: set { NumberOfQuestionsPerTopic.IspanelLoadQuizVisible = value; }
26: }
27:
28: protected void Page_Load(object sender, EventArgs e)
29: {
30: if(!Page.IsPostBack)
31: {
32: LoadUserRankings();
33: LoadCountryRankings();
34: }
35: }
36:
37: public void LoadUserRankings()
38: {
39: var quizNetSystem = new QuizNetSystem();
40: var sqlWrapper = new SqlWrapper();
41:
42: for (int j = 0; j < 6; j++)
43: {
44: DataTable tblMonthRankings = quizNetSystem.GetRankings(Enum.GetName(typeof(Topics), j), QuizNetSystem.Period.Month, sqlWrapper);
45: DataTable tblYearRankings = quizNetSystem.GetRankings(Enum.GetName(typeof(Topics), j), QuizNetSystem.Period.Year, sqlWrapper);
46: DataTable tblAllRankings = quizNetSystem.GetRankings(Enum.GetName(typeof(Topics), j), QuizNetSystem.Period.All, sqlWrapper);
47:
48: for (int i = 0; i < 6; i++)
49: {
50: if (tblMonthRankings.Rows.Count > i)
51: {
52: var row=new TableRow();
53: var cell=new TableCell();
54:
55: string tableName = "tblMonth" + Enum.GetName(typeof (Topics), j);
56: var tbl = (Table)TabPanelMonth.FindControl(tableName);
57:
58: var lbl=new Label
59: {
60: Text = ConfigureRankingsLabel(i, tblMonthRankings.Rows[i], true)
61: };
62: //lbl.BackColor=System.Drawing.Color.Green;
63: cell.Controls.Add(lbl);
64:
65: row.Cells.Add(cell);
66: tbl.Rows.Add(row);
67:
68: }
69: if (tblYearRankings.Rows.Count > i)
70: {
71: var row = new TableRow();
72: var cell = new TableCell();
73:
74: string tableName = "tblYear" + Enum.GetName(typeof(Topics), j);
75: var tbl = (Table)TabPanelYear.FindControl(tableName);
76:
77: var lbl = new Label
78: {
79: Text = ConfigureRankingsLabel(i, tblYearRankings.Rows[i], true)
80: };
81: cell.Controls.Add(lbl);
82:
83: row.Cells.Add(cell);
84: tbl.Rows.Add(row);
85: }
86: if (tblAllRankings.Rows.Count > i)
87: {
88: var row = new TableRow();
89: var cell = new TableCell();
90:
91: string tableName = "tblAll" + Enum.GetName(typeof(Topics), j);
92: var tbl = (Table)TabPanelAll.FindControl(tableName);
93:
94: var lbl = new Label
95: {
96: Text = ConfigureRankingsLabel(i, tblAllRankings.Rows[i], true)
97: };
98: cell.Controls.Add(lbl);
99:
100: row.Cells.Add(cell);
101: tbl.Rows.Add(row);
102: }
103: }
104: }
105: }
106:
107: public void LoadCountryRankings()
108: {
109: var quizNetSystem = new QuizNetSystem();
110: var sqlWrapper = new SqlWrapper();
111:
112: for (int j = 0; j < 6; j++)
113: {
114: DataTable tblMonthCountry = quizNetSystem.GetCountryRankings(Enum.GetName(typeof(Topics), j), QuizNetSystem.Period.Month, sqlWrapper);
115: DataTable tblYearCountry = quizNetSystem.GetCountryRankings(Enum.GetName(typeof(Topics), j), QuizNetSystem.Period.Year, sqlWrapper);
116: DataTable tblAllCountry = quizNetSystem.GetCountryRankings(Enum.GetName(typeof(Topics), j), QuizNetSystem.Period.All, sqlWrapper);
117:
118: for (int i = 0; i < 6; i++)
119: {
120: if (tblMonthCountry.Rows.Count > i)
121: {
122: var row = new TableRow();
123: var cell = new TableCell();
124:
125: string tableName = "tblMonthCountry" + Enum.GetName(typeof(Topics), j);
126: var tbl = (Table)TabPanelCountryMonth.FindControl(tableName);
127:
128: var lbl = new Label
129: {
130: Text = ConfigureRankingsLabel(i, tblMonthCountry.Rows[i], false)
131: };
132: cell.Controls.Add(lbl);
133:
134: row.Cells.Add(cell);
135: tbl.Rows.Add(row);
136: }
137: if (tblYearCountry.Rows.Count > i)
138: {
139: var row = new TableRow();
140: var cell = new TableCell();
141:
142: string tableName = "tblYearCountry" + Enum.GetName(typeof(Topics), j);
143: var tbl = (Table)TabPanelCountryYear.FindControl(tableName);
144:
145: var lbl = new Label
146: {
147: Text = ConfigureRankingsLabel(i, tblYearCountry.Rows[i], false)
148: };
149: cell.Controls.Add(lbl);
150:
151: There is a limit of 150 source code lines in the evaluation version
152: There is a limit of 150 source code lines in the evaluation version
153: There is a limit of 150 source code lines in the evaluation version
154: There is a limit of 150 source code lines in the evaluation version
155: There is a limit of 150 source code lines in the evaluation version
156: There is a limit of 150 source code lines in the evaluation version
157: There is a limit of 150 source code lines in the evaluation version
158: There is a limit of 150 source code lines in the evaluation version
159: There is a limit of 150 source code lines in the evaluation version
160: There is a limit of 150 source code lines in the evaluation version
161: There is a limit of 150 source code lines in the evaluation version
162: There is a limit of 150 source code lines in the evaluation version
163: There is a limit of 150 source code lines in the evaluation version
164: There is a limit of 150 source code lines in the evaluation version
165: There is a limit of 150 source code lines in the evaluation version
166: There is a limit of 150 source code lines in the evaluation version
167: There is a limit of 150 source code lines in the evaluation version
168: There is a limit of 150 source code lines in the evaluation version
169: There is a limit of 150 source code lines in the evaluation version
170: There is a limit of 150 source code lines in the evaluation version
171: There is a limit of 150 source code lines in the evaluation version
172: There is a limit of 150 source code lines in the evaluation version
173: There is a limit of 150 source code lines in the evaluation version
174: There is a limit of 150 source code lines in the evaluation version
175: There is a limit of 150 source code lines in the evaluation version
176: There is a limit of 150 source code lines in the evaluation version
177: There is a limit of 150 source code lines in the evaluation version
178: There is a limit of 150 source code lines in the evaluation version
179: There is a limit of 150 source code lines in the evaluation version
180: There is a limit of 150 source code lines in the evaluation version
181: There is a limit of 150 source code lines in the evaluation version
182: There is a limit of 150 source code lines in the evaluation version
183: There is a limit of 150 source code lines in the evaluation version
184: There is a limit of 150 source code lines in the evaluation version
185: There is a limit of 150 source code lines in the evaluation version
186: There is a limit of 150 source code lines in the evaluation version
187: There is a limit of 150 source code lines in the evaluation version
188: There is a limit of 150 source code lines in the evaluation version
189: There is a limit of 150 source code lines in the evaluation version
190: There is a limit of 150 source code lines in the evaluation version
191: There is a limit of 150 source code lines in the evaluation version
192: There is a limit of 150 source code lines in the evaluation version
193: There is a limit of 150 source code lines in the evaluation version
194: There is a limit of 150 source code lines in the evaluation version
195: There is a limit of 150 source code lines in the evaluation version
196: There is a limit of 150 source code lines in the evaluation version
197: There is a limit of 150 source code lines in the evaluation version
198: There is a limit of 150 source code lines in the evaluation version
199: There is a limit of 150 source code lines in the evaluation version
200: There is a limit of 150 source code lines in the evaluation version
201: There is a limit of 150 source code lines in the evaluation version
202: There is a limit of 150 source code lines in the evaluation version
203: There is a limit of 150 source code lines in the evaluation version
204: There is a limit of 150 source code lines in the evaluation version
205: There is a limit of 150 source code lines in the evaluation version
206: There is a limit of 150 source code lines in the evaluation version
207: There is a limit of 150 source code lines in the evaluation version
208: There is a limit of 150 source code lines in the evaluation version
209: There is a limit of 150 source code lines in the evaluation version
210: There is a limit of 150 source code lines in the evaluation version
211: There is a limit of 150 source code lines in the evaluation version
212: There is a limit of 150 source code lines in the evaluation version
213: There is a limit of 150 source code lines in the evaluation version
214: There is a limit of 150 source code lines in the evaluation version
.NET Documentation Tool is © 2002 - 2009 Winnersh Triangle Web Solutions Limited.