Exemple #1
0
        private void btnThemTK_Click(object sender, EventArgs e)
        {
            if (txtTenTK.Text.Equals("") || txtMKMoi.Text.Equals("") || txtMKMoi2.Text.Equals(""))
            {
                MessageBox.Show("Vui lòng nhập đủ thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            QLNS.Services.LogIn logInSer = new QLNS.Services.LogIn();

            TaiKhoanInfo taikhoan = new TaiKhoanInfo();

            taikhoan.ID = txtTenTK.Text;

            if (logInSer.CheckAcc(taikhoan))
            {
                MessageBox.Show("Trùng tên tài khoản", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (!txtMKMoi.Text.Equals(txtMKMoi2.Text))
            {
                MessageBox.Show("Mật khẩu nhập lại không trùng khớp", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            taikhoan.LoaiTK = 2;
            taikhoan.Pass   = txtMKMoi.Text;

            TaiKhoanDAO taikhoanDao = new TaiKhoanDAO();

            taikhoanDao.InsertAccount(taikhoan);
        }
Exemple #2
0
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            TaiKhoanInfo AccInfo = new TaiKhoanInfo();

            QLNS.Services.LogIn logInSer = new QLNS.Services.LogIn();
            AccInfo.ID   = txtTaiKhoan.Text;
            AccInfo.Pass = txtMatKhau.Text;
            LoaiTK       = logInSer.CheckPass(AccInfo);
            if (LoaiTK > 0)
            {
                MessageBox.Show(IDS_SUCCESS_LOGIN, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show(IDS_FAIL_LOGIN, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }