Exemplo n.º 1
0
 private void btnDangky_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtusername.Text == "")
         {
             MessageBox.Show("Bạn chưa điền username !", "Thông báo", MessageBoxButtons.OK);
             errorProvider1.SetError(txtusername, "null");
             txtusername.Focus();
         }
         else if (txtpass.Text != txtconfirm.Text)
         {
             MessageBox.Show("Xác nhận mật khẩu chưa chính xác !", "Thông báo", MessageBoxButtons.OK);
             txtpass.Focus();
         }
         else
         {
             TaiKhoanDTO tk = new TaiKhoanDTO();
             tk.username = txtusername.Text;
             tk.password = txtpass.Text;
             tk.ma_cv    = cbxCongviec.SelectedValue.ToString();
             TaiKhoanBUS.DangKy(tk);
             MessageBox.Show("Đăng ký thành công !", "Thông báo", MessageBoxButtons.OK);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
        protected void btnDangKy_Click(object sender, EventArgs e)
        {
            String      tenTaiKhoan, matKhau, hoTen, email, soDienThoai, diaChi;
            TaiKhoanDTO taiKhoanDTO;

            tenTaiKhoan = txtTenTaiKhoan.Text;
            matKhau     = txtMatKhau.Text;
            hoTen       = txtHoTen.Text;
            email       = txtEmail.Text;
            soDienThoai = txtSoDienThoai.Text;
            diaChi      = txtDiaChi.Text;
            taiKhoanDTO = new TaiKhoanDTO(tenTaiKhoan, matKhau, hoTen, email, soDienThoai, diaChi);
            //
            if (TaiKhoanBUS.DangKy(taiKhoanDTO))
            {
                Response.Write("<script>alert('Đăng ký tài khoản thành công!')</script>");
            }
            else
            {
                Response.Write("<script>alert('Đăng ký tài khoản không thành công!')</script>");
            }
            XoaForm();
        }