//KHI ĐĂNG XUẤT public void KhiDangXuat() { DangNhap_ThongTin DN = new DangNhap_ThongTin(); DN.TaiKhoan = txtTen.Text; DN.TrangThai = false; cls_DangNhap.UpDateTrangThai(DN); this.Close(); }
private void btInBaoCao_Click(object sender, EventArgs e) { DangNhap_ThongTin DN = new DangNhap_ThongTin(); DN.TaiKhoan = txtTimKiem.Text; BaoCao.BaoCao.DuLieu = cls_DangNhap.TimKiemTaiKhoan(DN); BaoCao.BaoCao.Kieu = "TimKiemTaiKhoan"; BaoCao.BaoCao BC = new BaoCao.BaoCao(); BC.ShowDialog(); }
public DoiMatKhau(DangNhap_ThongTin DN) { InitializeComponent(); this.TaiKhoan = DN.TaiKhoan; this.MatKhau = DN.MatKhau; this.Quyen = DN.Quyen; this.TrangThai = DN.TrangThai; txtMatKhauCu.Focus(); }
//TÌM KIẾM TÀI KHOẢN. public DataTable TimKiemTaiKhoan(DangNhap_ThongTin DN) { int Nparameter = 1; string[] name = new string[Nparameter]; object[] value = new object[Nparameter]; name[0] = "@TimKiem"; value[0] = DN.TaiKhoan; return cls.TimKiem("TimKiemTaiKhoan", name, value, Nparameter); }
private void btDoiMatKhau_Click(object sender, EventArgs e) { DangNhap_ThongTin DN = new DangNhap_ThongTin(); DN.TaiKhoan = this.TaiKhoan; DN.MatKhau = this.MatKhau; DN.Quyen = this.Quyen; DN.TrangThai = this.TrangThai; A.GiaoDien.DoiMatKhau DMK = new A.GiaoDien.DoiMatKhau(DN); DMK.ShowDialog(this); }
public int UpDateMatKhau(DangNhap_ThongTin DN) { int Nparameter = 2; string[] name = new string[Nparameter]; object[] value = new object[Nparameter]; name[0] = "@TaiKhoan"; value[0] = DN.TaiKhoan; name[1] = "@MatKhau"; value[1] = DN.MatKhau; return cls.CapNhat("UpDateMatKhau", name, value, Nparameter); }
//THÊM 1 TÀI KHOẢN. public int ThemTaiKhoan(DangNhap_ThongTin DN) { int Nparameter = 2; string[] name = new string[Nparameter]; object[] value = new object[Nparameter]; name[0] = "@TaiKhoan"; value[0] = DN.TaiKhoan; name[1] = "@Quyen"; value[1] = DN.Quyen; return cls.CapNhat("ThemTaiKhoan", name, value, Nparameter); }
public DataTable KiemTraDangNhap(DangNhap_ThongTin DN) { int Nparameter = 2; string[] name = new string[Nparameter]; object[] value = new object[Nparameter]; name[0] = "@TaiKhoan"; value[0] = DN.TaiKhoan; name[1] = "@MatKhau"; value[1] = DN.MatKhau; return cls.TimKiem("KiemTraDangNhap", name, value, Nparameter); }
//LẤY DỮ LIỆU GỬI VỀ. public void LayDuLieu(DangNhap_ThongTin DN) { this.TaiKhoan = DN.TaiKhoan; if (!this.TaiKhoan.Equals("")) { try { tbDanhSachTaiKhoan.DataSource = cls_DangNhap.DanhSachTaiKhoan(); } catch { } } txtTimKiem.Focus(); }
public GiaoDienChinh(DangNhap_ThongTin DN) { InitializeComponent(); txtQuyen.Text = DN.Quyen; txtTen.Text = DN.TaiKhoan; this.TaiKhoan = DN.TaiKhoan; this.MatKhau = DN.MatKhau; this.Quyen = DN.Quyen; this.TrangThai = DN.TrangThai; TrangChu TC = new TrangChu(); TC.TopLevel = false; HienThi.Controls.Clear(); HienThi.Controls.Add(TC); TC.Show(); }
//ĐĂNG NHẬP private void DangNhapTaiKhoan() { if (txtTaiKhoan.Text.Equals("")) { MessageBox.Show("Bạn hãy nhập tài khoản của mình", "Thông báo.", MessageBoxButtons.OK, MessageBoxIcon.None); txtTaiKhoan.Focus(); } else { if (txtMatKhau.Text.Equals("")) { MessageBox.Show("Bạn hãy nhập mật khẩu của mình", "Thông báo.", MessageBoxButtons.OK, MessageBoxIcon.None); txtMatKhau.Focus(); } else { DangNhap_ThongTin DN = new DangNhap_ThongTin(); DN.TaiKhoan = txtTaiKhoan.Text; DN.MatKhau = txtMatKhau.Text; DataTable Bang = new DataTable(); DataRow Hang; Bang = cls_DangNhap.KiemTraDangNhap(DN); try { Hang = Bang.Rows[0]; Quyen = Hang["Quyen"].ToString(); DN.Quyen = Quyen; DN.TrangThai = true; cls_DangNhap.UpDateTrangThai(DN); A.GiaoDien.GiaoDienChinh GDC = new A.GiaoDien.GiaoDienChinh(DN); GDC.ShowDialog(this); this.Close(); } catch { MessageBox.Show("Tài khoản hoặc mật khẩu của bạn bị sai, hãy kiểm tra lại!", "Thông báo lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error); txtMatKhau.Text = ""; txtTaiKhoan.Focus(); } } } txtMatKhau.Focus(); }
public int UpDateMatKhau(DangNhap_ThongTin DN) { return cls.UpDateMatKhau(DN); }
public int ChinhSuaQuyen(DangNhap_ThongTin DN) { return cls.ChinhSuaQuyen(DN); }
//KHI KÍCH THỰC HIỆN. private void XuLyThayDoiMatKhau() { if (txtMatKhauCu.Text.Equals("")) { MessageBox.Show("Bạn hãy nhập vào mật khẩu cũ!", "Thông báo lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error); txtMatKhauCu.Focus(); } else { if (txtMatKhauMoi.Text.Equals("")) { MessageBox.Show("Bạn hãy nhập vào mật khẩu mới!", "Thông báo lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error); txtMatKhauMoi.Focus(); } else { if (txtNhapLaiMatKhauMoi.Text.Equals("")) { MessageBox.Show("Bạn hãy xác nhận lại mật khẩu mới!", "Thông báo lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error); txtNhapLaiMatKhauMoi.Focus(); } else { if (!txtMatKhauMoi.Text.Equals(txtNhapLaiMatKhauMoi.Text)) { MessageBox.Show("Xác nhận mật khẩu không chính xác, hãy nhập lại để xác nhận lại!", "Thông báo lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error); txtNhapLaiMatKhauMoi.Text = ""; txtNhapLaiMatKhauMoi.Focus(); } else { DangNhap_ThongTin DN = new DangNhap_ThongTin(); DN.TaiKhoan = this.TaiKhoan; DN.MatKhau = txtMatKhauCu.Text; DataTable Bang = new DataTable(); DataRow Hang; Bang = cls_DangNhap.KiemTraDangNhap(DN); try { Hang = Bang.Rows[0]; DN.MatKhau = txtNhapLaiMatKhauMoi.Text; cls_DangNhap.UpDateMatKhau(DN); MessageBox.Show("Thay đổi mật khẩu thành công.", "Thông báo.", MessageBoxButtons.OK, MessageBoxIcon.None); this.Hide(); } catch { MessageBox.Show("Mật khẩu của bạn bị sai, hãy kiểm tra lại!", "Thông báo lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error); txtMatKhauCu.Text = ""; txtMatKhauCu.Focus(); } } } } } }
public DataTable KiemTraDangNhap(DangNhap_ThongTin DN) { return cls.KiemTraDangNhap(DN); }
private void KhiAnTimKiem(object sender, KeyEventArgs e) { if (!e.KeyValue.ToString().Equals("120") && !e.KeyValue.ToString().Equals("121") && !e.KeyValue.ToString().Equals("122") && !e.KeyValue.ToString().Equals("123")) { txtTimKiem.BackColor = Color.White; DangNhap_ThongTin DN = new DangNhap_ThongTin(); DN.TaiKhoan = txtTimKiem.Text; tbDanhSachTaiKhoan.DataSource = cls_DangNhap.TimKiemTaiKhoan(DN); } if (e.KeyValue.ToString().Equals("120")) { ThemTaiKhoan(); txtTimKiem.Focus(); } if (e.KeyValue.ToString().Equals("121")) { SuaTaiKhoan(); txtTimKiem.Focus(); } if (e.KeyValue.ToString().Equals("122")) { XoaTaiKhoan(); txtTimKiem.Focus(); } if (e.KeyValue.ToString().Equals("123")) { txtTimKiem.BackColor = Color.YellowGreen; txtTimKiem.Focus(); } txtTimKiem.Focus(); }
//XÓA TÀI KHOẢN private void XoaTaiKhoan() { if (XacNhanXoa == 1) { DangNhap_ThongTin DangNhap = new DangNhap_ThongTin(); DangNhap.TaiKhoan = tbDanhSachTaiKhoan.Rows[DongChon].Cells[0].Value.ToString(); if (MessageBox.Show("Bạn có thật sự muốn xóa thông tin tài khoản " + DangNhap.TaiKhoan + "", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { cls_DangNhap.XoaTaiKhoan(DangNhap); tbDanhSachTaiKhoan.DataSource = cls_DangNhap.DanhSachTaiKhoan(); } catch { MessageBox.Show("Không thể xóa dữ liệu này, hãy kiểm tra lại.!", "Thông báo lỗi.", MessageBoxButtons.OK, MessageBoxIcon.Error); } } XacNhanXoa = 0; txtTimKiem.Focus(); } else { MessageBox.Show("Bạn hãy chọn khóa học muốn xóa.", "Thông báo.", MessageBoxButtons.OK, MessageBoxIcon.Error); txtTimKiem.Focus(); } }
public int ThemTaiKhoan(DangNhap_ThongTin DN) { return cls.ThemTaiKhoan(DN); }
//KHI KÍCH BUTTON THÊM private void ThemTaiKhoan() { ChucNang = "F9"; DangNhap_ThongTin DangNhap = new DangNhap_ThongTin(); A.GiaoDien.QuanLyTaiKhoan QLTK = new A.GiaoDien.QuanLyTaiKhoan(ChucNang, DangNhap); QLTK.DuLieu = new QuanLyTaiKhoan.DuLieuTruyenVe(LayDuLieu); QLTK.ShowDialog(this); XacNhanXoa = 0; txtTimKiem.Focus(); }
//KHI KÍCH BUTTON SỬA THÔNG TIN private void SuaTaiKhoan() { ChucNang = "F10"; DangNhap_ThongTin DangNhap = new DangNhap_ThongTin(); DangNhap.TaiKhoan = tbDanhSachTaiKhoan.Rows[DongChon].Cells[0].Value.ToString(); DangNhap.Quyen = tbDanhSachTaiKhoan.Rows[DongChon].Cells[1].Value.ToString(); A.GiaoDien.QuanLyTaiKhoan QLTK = new A.GiaoDien.QuanLyTaiKhoan(ChucNang, DangNhap); QLTK.DuLieu = new QuanLyTaiKhoan.DuLieuTruyenVe(LayDuLieu); QLTK.ShowDialog(this); XacNhanXoa = 0; txtTimKiem.Focus(); }
public int XoaTaiKhoan(DangNhap_ThongTin DN) { return cls.XoaTaiKhoan(DN); }
public int UpDateTrangThai(DangNhap_ThongTin DN) { return cls.UpDateTrangThai(DN); }
public DataTable TimKiemTaiKhoan(DangNhap_ThongTin DN) { return cls.TimKiemTaiKhoan(DN); }