-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShowStudent.aspx.cs
40 lines (38 loc) · 1.25 KB
/
ShowStudent.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Assignment_2ab
{
public partial class ShowStudent : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
bool valid = true;
string studentid = Request.QueryString["studentid"];
if (String.IsNullOrEmpty(studentid)) valid = false;
if (valid)
{
var db = new Schooldb();
Dictionary<String, String> student_record = db.FindStudent(Int32.Parse(studentid));
if(student_record.Count> 0)
{
student_fname.InnerHtml = student_record["STUDENTFNAME"];
student_lname.InnerHtml = student_record["STUDENTLNAME"];
student_number.InnerHtml = student_record["STUDENTNUMBER"];
enrolment_date.InnerHtml = student_record["ENROLMENTDATE"];
}
else
{
valid = false;
}
}
if (!valid)
{
student.InnerHtml = "Wrong details entered!!";
}
}
}
}