protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == true) { if (Request["btnLogin"] != null) { try { StudentInfo.StudentInfoWS service = new StudentInfo.StudentInfoWS(); string taiKhoan = Request["txt_RecordID"].ToString(); string matKhau = Request["txt_Pass"].ToString(); if (service.checkLogin(taiKhoan, matKhau)) { Session["RecordID"] = taiKhoan; Response.Redirect("Default.aspx"); } else { divNotification.Visible = true; divNotification.InnerHtml = "Đăng nhập thất bại"; return; } } catch { divNotification.Visible = true; divNotification.InnerHtml = "Đăng nhập thất bại"; return; } } } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == true) { if (Request["btnChangePass"] != null) { try { if (Session["RecordID"] != null) // nếu đăng nhập thì hiển thị thông tin sinh viên { StudentInfo.StudentInfoWS service = new StudentInfo.StudentInfoWS(); string taiKhoan = (string)Session["RecordID"]; string matKhauCu = Request["txt_OldPass"].ToString(); string matKhauMoi = Request["txt_NewPass"].ToString(); string xacNhanMatKhauMoi = Request["txt_ConfirmNewPass"].ToString(); if (matKhauMoi.Equals(xacNhanMatKhauMoi)) { if (service.checkLogin(taiKhoan, matKhauCu)) { if (service.changePassword(taiKhoan, matKhauMoi)) { divNotification.Visible = true; divNotification.InnerHtml = "Đổi mật khẩu thành công."; Session["RecordID"] = null; return; } else { divNotification.Visible = true; divNotification.InnerHtml = "Đổi mật khẩu thất bại."; return; } } else { divNotification.Visible = true; divNotification.InnerHtml = "Mật khẩu sai."; return; } } else { divNotification.Visible = true; divNotification.InnerHtml = "Mật khẩu không khớp."; return; } } } catch { divNotification.Visible = true; divNotification.InnerHtml = "Đăng nhập thất bại"; return; } } } }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["RecordID"] != null) // nếu đăng nhập thì hiển thị thông tin sinh viên { StudentInfo.StudentInfoWS service = new StudentInfo.StudentInfoWS(); string taiKhoan = (string)Session["RecordID"]; DataSet dataSet = service.getStudentInfo(taiKhoan); td_HoTen.InnerText = ""; td_NgaySinh.InnerText = ""; td_HKTT.InnerText = ""; td_NoiSinh.InnerText = ""; td_CMND.InnerText = ""; td_MaSV.InnerText = ""; td_Lop.InnerText = ""; td_TTHT.InnerText = ""; if (dataSet.Tables[0].Rows.Count > 0) { if (dataSet.Tables[0].Rows[0]["HO"] != System.DBNull.Value) { td_HoTen.InnerText = (string)dataSet.Tables[0].Rows[0]["HO"]; } if (dataSet.Tables[0].Rows[0]["TEN"] != System.DBNull.Value) { td_HoTen.InnerText += " " + (string)dataSet.Tables[0].Rows[0]["TEN"]; } if (dataSet.Tables[0].Rows[0]["NGAYSINH"] != System.DBNull.Value) { td_NgaySinh.InnerText = (string)dataSet.Tables[0].Rows[0]["NGAYSINH"]; } if (dataSet.Tables[0].Rows[0]["HKTT"] != System.DBNull.Value) { td_HKTT.InnerText = (string)dataSet.Tables[0].Rows[0]["HKTT"]; } if (dataSet.Tables[0].Rows[0]["NOISINH"] != System.DBNull.Value) { td_NoiSinh.InnerText = (string)dataSet.Tables[0].Rows[0]["NOISINH"]; } if (dataSet.Tables[0].Rows[0]["CMND"] != System.DBNull.Value) { td_CMND.InnerText = (string)dataSet.Tables[0].Rows[0]["CMND"]; } if (dataSet.Tables[0].Rows[0]["MASV"] != System.DBNull.Value) { td_MaSV.InnerText = (string)dataSet.Tables[0].Rows[0]["MASV"]; } if (dataSet.Tables[0].Rows[0]["TENLOP"] != System.DBNull.Value) { td_Lop.InnerText = (string)dataSet.Tables[0].Rows[0]["TENLOP"]; } if (dataSet.Tables[0].Rows[0]["XOA"] != System.DBNull.Value) { string xoa = Convert.ToString((int)(byte)dataSet.Tables[0].Rows[0]["XOA"]); string valueStatus = ""; if (xoa == "0" || xoa == "") { valueStatus = "Đang học"; } if (xoa == "1" || xoa == "4") { valueStatus = "Buộc thôi học"; } if (xoa == "2") { valueStatus = "Ngừng học"; } if (xoa == "3") { valueStatus = "Ngừng học"; } if (xoa == "13") { valueStatus = "Đã tốt nghiệp (ra trường)"; } td_TTHT.InnerText = valueStatus; } else { td_TTHT.InnerText = "Đang học"; } } dataSet = service.getStudentTranscript(taiKhoan); StringBuilder html = new StringBuilder(); if (dataSet.Tables[0].Rows.Count > 0) { // body int stt = 1; int hocKy = 1; addTableHeader(html, hocKy); foreach (DataRow row in dataSet.Tables[0].Rows) { int HK = (int)(byte)row["HK"]; if (hocKy == HK) { addTableContent(html, row, stt); } else { html.Append("</tbody>"); html.Append("</table>"); hocKy = HK; stt = 1; addTableHeader(html, hocKy); addTableContent(html, row, stt); } stt++; } html.Append("</tbody>"); html.Append("</table>"); tableTranscript.Controls.Add(new Literal { Text = html.ToString() }); } else { html.Append("<h1>Không có dữ liệu điểm.</h1>"); tableTranscript.Controls.Add(new Literal { Text = html.ToString() }); } } else // nếu chưa đăng nhập thì redirect trang chủ CaoThang { Response.Redirect("Default.aspx"); } } catch { Response.Redirect("Default.aspx"); return; } }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["RecordID"] != null) // nếu đăng nhập thì hiển thị thông tin sinh viên { StudentInfo.StudentInfoWS service = new StudentInfo.StudentInfoWS(); string taiKhoan = (string)Session["RecordID"]; DataSet dataSet = service.getStudentDecision(taiKhoan); StringBuilder html = new StringBuilder(); if (dataSet.Tables[0].Rows.Count > 0) { html.Append("<table class='table table-bordered'>"); // header html.Append("<thead>"); html.Append("<tr>"); html.Append("<th>STT</th>"); html.Append("<th>Nội dung quyết định</th>"); html.Append("<th>Ngày áp dụng</th>"); html.Append("<th>Loại quyết định</th>"); html.Append("<th>Ghi chú</th>"); html.Append("</tr>"); html.Append("</thead>"); // body int stt = 1; html.Append("<tbody>"); foreach (DataRow row in dataSet.Tables[0].Rows) { html.Append("<tr>"); html.Append("<th scope='row'>"); html.Append(stt); html.Append("</th>"); foreach (DataColumn column in dataSet.Tables[0].Columns) { html.Append("<td>"); html.Append(row[column.ColumnName]); html.Append("</td>"); } html.Append("</tr>"); stt++; } html.Append("<tbody>"); html.Append("</table>"); tableDecision.Controls.Add(new Literal { Text = html.ToString() }); } else { html.Append("<h1>Không có quyết định nào</h1>"); tableDecision.Controls.Add(new Literal { Text = html.ToString() }); } } else // nếu chưa đăng nhập thì redirect trang chủ CaoThang { Response.Redirect("Default.aspx"); } } catch { Response.Redirect("Default.aspx"); return; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["RecordID"] != null) // nếu đăng nhập thì hiển thị thông tin sinh viên { StudentInfo.StudentInfoWS service = new StudentInfo.StudentInfoWS(); string taiKhoan = (string)Session["RecordID"]; DataSet dataSet = service.getStudentInfo(taiKhoan); txt_HoTen.Value = ""; txt_NgaySinh.Value = ""; txt_HKTT.Value = ""; txt_NoiSinh.Value = ""; txt_CMND.Value = ""; txt_MaSV.Value = ""; txt_Lop.Value = ""; txt_TTHT.Value = ""; if (dataSet.Tables[0].Rows.Count > 0) { if (dataSet.Tables[0].Rows[0]["HO"] != System.DBNull.Value) { txt_HoTen.Value = (string)dataSet.Tables[0].Rows[0]["HO"]; } if (dataSet.Tables[0].Rows[0]["TEN"] != System.DBNull.Value) { txt_HoTen.Value += " " + (string)dataSet.Tables[0].Rows[0]["TEN"]; } if (dataSet.Tables[0].Rows[0]["NGAYSINH"] != System.DBNull.Value) { txt_NgaySinh.Value = (string)dataSet.Tables[0].Rows[0]["NGAYSINH"]; } if (dataSet.Tables[0].Rows[0]["HKTT"] != System.DBNull.Value) { txt_HKTT.Value = (string)dataSet.Tables[0].Rows[0]["HKTT"]; } if (dataSet.Tables[0].Rows[0]["NOISINH"] != System.DBNull.Value) { txt_NoiSinh.Value = (string)dataSet.Tables[0].Rows[0]["NOISINH"]; } if (dataSet.Tables[0].Rows[0]["CMND"] != System.DBNull.Value) { txt_CMND.Value = (string)dataSet.Tables[0].Rows[0]["CMND"]; } if (dataSet.Tables[0].Rows[0]["MASV"] != System.DBNull.Value) { txt_MaSV.Value = (string)dataSet.Tables[0].Rows[0]["MASV"]; } if (dataSet.Tables[0].Rows[0]["TENLOP"] != System.DBNull.Value) { txt_Lop.Value = (string)dataSet.Tables[0].Rows[0]["TENLOP"]; } if (dataSet.Tables[0].Rows[0]["XOA"] != System.DBNull.Value) { string xoa = Convert.ToString((int)(byte)dataSet.Tables[0].Rows[0]["XOA"]); string valueStatus = ""; if (xoa == null || xoa == "0" || xoa == "") { valueStatus = "Đang học"; } if (xoa == "1" || xoa == "4") { valueStatus = "Buộc thôi học"; } if (xoa == "2") { valueStatus = "Ngừng học"; } if (xoa == "3") { valueStatus = "Ngừng học"; } if (xoa == "13") { valueStatus = "Đã tốt nghiệp (ra trường)"; } txt_TTHT.Value = valueStatus; } } else { // không có dữ liệu } } else // nếu chưa đăng nhập thì redirect trang chủ CaoThang { Response.Redirect("Default.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["RecordID"] != null) // nếu đăng nhập thì hiển thị thông tin sinh viên { StudentInfo.StudentInfoWS service = new StudentInfo.StudentInfoWS(); string taiKhoan = (string)Session["RecordID"]; DataSet dataSet = service.getStudentInfo(taiKhoan); td_HoTen.InnerText = ""; td_NgaySinh.InnerText = ""; td_HKTT.InnerText = ""; td_NoiSinh.InnerText = ""; td_CMND.InnerText = ""; td_MaSV.InnerText = ""; td_Lop.InnerText = ""; td_TTHT.InnerText = ""; if (dataSet.Tables[0].Rows.Count > 0) { if (dataSet.Tables[0].Rows[0]["HO"] != System.DBNull.Value) { td_HoTen.InnerText = (string)dataSet.Tables[0].Rows[0]["HO"]; } if (dataSet.Tables[0].Rows[0]["TEN"] != System.DBNull.Value) { td_HoTen.InnerText += " " + (string)dataSet.Tables[0].Rows[0]["TEN"]; } if (dataSet.Tables[0].Rows[0]["NGAYSINH"] != System.DBNull.Value) { td_NgaySinh.InnerText = (string)dataSet.Tables[0].Rows[0]["NGAYSINH"]; } if (dataSet.Tables[0].Rows[0]["HKTT"] != System.DBNull.Value) { td_HKTT.InnerText = (string)dataSet.Tables[0].Rows[0]["HKTT"]; } if (dataSet.Tables[0].Rows[0]["NOISINH"] != System.DBNull.Value) { td_NoiSinh.InnerText = (string)dataSet.Tables[0].Rows[0]["NOISINH"]; } if (dataSet.Tables[0].Rows[0]["CMND"] != System.DBNull.Value) { td_CMND.InnerText = (string)dataSet.Tables[0].Rows[0]["CMND"]; } if (dataSet.Tables[0].Rows[0]["MASV"] != System.DBNull.Value) { td_MaSV.InnerText = (string)dataSet.Tables[0].Rows[0]["MASV"]; } if (dataSet.Tables[0].Rows[0]["TENLOP"] != System.DBNull.Value) { td_Lop.InnerText = (string)dataSet.Tables[0].Rows[0]["TENLOP"]; } if (dataSet.Tables[0].Rows[0]["XOA"] != System.DBNull.Value) { string xoa = Convert.ToString((int)(byte)dataSet.Tables[0].Rows[0]["XOA"]); string valueStatus = ""; if (xoa == null || xoa == "0" || xoa == "") { valueStatus = "Đang học"; } if (xoa == "1" || xoa == "4") { valueStatus = "Buộc thôi học"; } if (xoa == "2") { valueStatus = "Ngừng học"; } if (xoa == "3") { valueStatus = "Ngừng học"; } if (xoa == "13") { valueStatus = "Đã tốt nghiệp (ra trường)"; } td_TTHT.InnerText = valueStatus; } } dataSet = service.getStudentSemester(taiKhoan); int HK = 0; if (dataSet.Tables[0].Rows.Count > 0) { if (dataSet.Tables[0].Rows[0]["HK"] != System.DBNull.Value) { HK = (int)(byte)dataSet.Tables[0].Rows[0]["HK"]; } } if (taiKhoan.Substring(1, 1).Equals("2")) { if (HK > 4) { HK = 4; } } else { if (HK > 6) { HK = 6; } } dataSet = service.getStudentTuition(taiKhoan); StringBuilder html = new StringBuilder(); if (dataSet.Tables[0].Rows.Count > 0) { addTable(html, dataSet.Tables[0].Rows[0], HK); tableTuition.Controls.Add(new Literal { Text = html.ToString() }); } else { html.Append("<h1>Không có dữ liệu học phí.</h1>"); tableTuition.Controls.Add(new Literal { Text = html.ToString() }); } } else // nếu chưa đăng nhập thì redirect trang chủ CaoThang { Response.Redirect("Default.aspx"); } } catch { Response.Redirect("Default.aspx"); return; } }