//Đăng Nhập private void btnLogin_Click(object sender, EventArgs e) { if (BUS_Tai_Khoan.Kiem_tra_Tai_Khoan(txtUserName.Text, txtPassWord.Text)) { this.Hide(); if (BUS_Tai_Khoan.Quyen(txtUserName.Text).Contains("HS")) { Hoc_Sinhh hoc_Sinh = BUS_Tai_Khoan.layThongTinTaiKhoan(txtUserName.Text) as Hoc_Sinhh; frmHoc_Sinh.hs = hoc_Sinh; frmHoc_Sinh hs = new frmHoc_Sinh(); hs.ShowDialog(); } else if (BUS_Tai_Khoan.Quyen(txtUserName.Text).Contains("AD")) { Tai_khoan tk = BUS_Tai_Khoan.layThongTinTaiKhoan(txtUserName.Text) as Tai_khoan; frmAdmin.tk = tk; frmAdmin admin = new frmAdmin(); admin.ShowDialog(); } else if (BUS_Tai_Khoan.Quyen(txtUserName.Text).Contains("GV")) { Giao_Vienn tk = BUS_Tai_Khoan.layThongTinTaiKhoan(txtUserName.Text) as Giao_Vienn; frmGiao_Vien.giaoVien = tk; frmGiao_Vien admin = new frmGiao_Vien(); admin.ShowDialog(); } txtPassWord.Clear(); txtUserName.Clear(); } }
//Xem Thông Tin Cá Nhân private void btnInformation_Click(object sender, EventArgs e) { frmThong_Tin thong_Tin = new frmThong_Tin(); thong_Tin.hs_new = hs; thong_Tin.ShowDialog(); hs = BUS_Tai_Khoan.layThongTinTaiKhoan(hs.Tai_Khoan) as Hoc_Sinhh; }
//đổi mật khẩu private void btnLuu_Click(object sender, EventArgs e) { if (BUS_Tai_Khoan.Doi_mat_khau(Tai_Khoan, txtOldPass.Text, txtPassWord.Text)) { MessageBox.Show("Đổi mật khẩu thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Đổi mật khẩu không thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnSave_Click(object sender, EventArgs e) { loi = UserAccount.ErrorMessage; loi = UserCMND_TCC.ErrorMessage; if (loi == "") { NGUOIDUNG nguoi_dung = new NGUOIDUNG(); nguoi_dung.TaiKhoan = txtSudent_code.Text; nguoi_dung.MatKhau = txtPassword.Text; nguoi_dung.HoTen = txtStudent_Name.Text; nguoi_dung.CMND_TCC = txtCMND.Text; nguoi_dung.NgaySinh = dpStudent_birth_date.Value; if (cbb_Quyen.Text == "HỌC SINH") { if (txtStudent_class.Text != "") { nguoi_dung.MaLop = BUS_Tai_Khoan.ID_Lop(txtStudent_class.Text); } } else if (cbb_Quyen.Text == "GIÁO VIÊN") { if (txtStudent_class.Text != "") { nguoi_dung.MaKhoi = BUS_Tai_Khoan.ID_Khoi(txtStudent_class.Text); } } nguoi_dung.MaPhanQuyen = BUS_Tai_Khoan.ID_Quyen(cbb_Quyen.Text); BUS_Tai_Khoan.Them_nguoi_dung(nguoi_dung); txtCMND.Clear(); txtPassword.Clear(); txtStudent_class.Clear(); txtStudent_Name.Clear(); txtSudent_code.Clear(); } else { MessageBox.Show("Chưa Hợp Lệ", "Cảnh Báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmHoc_Sinh_Load(object sender, EventArgs e) { controlStudent.TabPages.Clear(); hs = BUS_Tai_Khoan.layThongTinTaiKhoan(hs.Tai_Khoan) as Hoc_Sinhh; }