Exemple #1
0
 private void btnXuLy_Click(object sender, EventArgs e)
 {
     if (this.check == true)//Tao tai khoan
     {
         if (cboRole.SelectedIndex == 0)
         {
             MessageBox.Show("Hãy chọn Role cho tài khoản");
         }
         else
         {
             DialogResult dlr = MessageBox.Show("Bạn chắc chắn muốn tạo tài khoản không??", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (dlr == DialogResult.Yes) // dong y tao tai khoan
             {
                 //luu tai khoan
                 clsTaiKhoan tkThem = new clsTaiKhoan();
                 tkThem._Id_NV       = int.Parse(txtUser.Tag.ToString());
                 tkThem._StrUsername = txtUser.Text;
                 tkThem._StrPassWord = txtPass.Text;
                 tkThem._MaRole      = (int)cboRole.SelectedValue;
                 if (cnnTK.ThemTaiKhoan(tkThem))// luu DB thanh cong
                 {
                     MessageBox.Show("Tạo tài khoản thành công!");
                     check = true;
                     frmQLNV_Load(sender, e);
                 }
                 else // luu DB that bai
                 {
                     MessageBox.Show("Tạo tài khoản không thành công!\nHãy tạo lại", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 }
             }
             else // khong dong y tao tai khoan
             {
                 MessageBox.Show("Tài khoản chưa được tạo!!");
             }
         }
     }
     else // Huy tai khoan
     {
         DialogResult dlr = MessageBox.Show("Bạn chắc chắn muốn hủy tài khoản này không??", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dlr == DialogResult.Yes)
         {
             int maTKHuy = int.Parse(txtUser.Tag.ToString());
             if (cnnTK.XoaTaiKhoan(maTKHuy))
             {
                 MessageBox.Show("Hủy tài khoản thành công!");
                 check = false;
                 frmQLNV_Load(sender, e);
             }
             else // luu DB that bai
             {
                 MessageBox.Show("Hủy tài khoản không thành công!\nHãy hủy lại", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
         }
         else
         {
             MessageBox.Show("Tài khoản chưa được hủy!!");
         }
     }
 }
Exemple #2
0
 public clsNhanVienTuyenDung(string id, string hoTen, string chucVu, clsTaiKhoan taiKhoan)
 {
     this.id_NV       = null;
     this.strHoTen_NV = hoTen;
     this.strChucVu   = chucVu;
     //this.strQuyenHan = quyenHan;
     this.tk = taiKhoan;
 }
Exemple #3
0
 public clsNhanVienTuyenDung()
 {
     this.id_NV       = null;
     this.strHoTen_NV = null;
     this.strChucVu   = null;
     //this.strQuyenHan = null;
     this.tk = null;
 }
Exemple #4
0
 public clsTruongPhongTuyenDung(string id, string hoTen, string chucVu, clsTaiKhoan taiKhoan) : base(id, hoTen, chucVu, taiKhoan)
 {
 }