本文整理汇总了C#中DBFunctions.getresult方法的典型用法代码示例。如果您正苦于以下问题:C# DBFunctions.getresult方法的具体用法?C# DBFunctions.getresult怎么用?C# DBFunctions.getresult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBFunctions
的用法示例。
在下文中一共展示了DBFunctions.getresult方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: showresult
public void showresult()
{
Resultlbl.Text = "<tr class='blue-background'><th>Course</th><th>Total Marks</th><th>Obtained</th><th>Grade</th></tr>";
int total = 0;
DBFunctions db = new DBFunctions();
int stdid = int.Parse(Session["userid"].ToString());
var result = db.getresult(stdid,dropdownterm.SelectedValue);
//<th>Course</th><th>Total Marks</th><th>Obtained</th><th>Grade</th>
foreach (var r in result)
{
Resultlbl.Text += "<tr><td>" + r.Courses_tbl.Course + "</td><td>" + r.TotalMarks + "</td><td>" + r.ObtainedMarks + "</td>";
total += r.ObtainedMarks.Value;
if (r.ObtainedMarks >= 90)
Resultlbl.Text += "<td>A</td></tr>";
else if (r.ObtainedMarks >= 85 && r.ObtainedMarks < 90)
Resultlbl.Text += "<td>A-</td></tr>";
else if (r.ObtainedMarks >= 80 && r.ObtainedMarks < 85)
Resultlbl.Text += "<td>B+</td></tr>";
else if (r.ObtainedMarks >= 70 && r.ObtainedMarks < 80)
Resultlbl.Text += "<td>B</td></tr>";
else if (r.ObtainedMarks >= 60 && r.ObtainedMarks < 70)
Resultlbl.Text += "<td>B-</td></tr>";
else if (r.ObtainedMarks >= 55 && r.ObtainedMarks < 60)
Resultlbl.Text += "<td>C+</td></tr>";
else if (r.ObtainedMarks >= 45 && r.ObtainedMarks < 55)
Resultlbl.Text += "<td>C</td></tr>";
}
Totalmarkslbl.Text = "<b class='h5'>Total marks: </b>" + total;
}