Exemplo n.º 1
0
 //ham thuc thi khi nhan nut doi pass
 private void btPass_Click(object sender, EventArgs e)
 {
     //check null
     if (txtmk1.Text != "" && txtmk2.Text != "" && txtmk3.Text != "")
     {
         //check xac nhan mat khau
         if (txtmk2.Text != txtmk3.Text)
         {
             MessageBox.Show("Mật khẩu xác nhận không trùng khớp");
         }
         else
         {
             //check change pass
             if (balAccount.ChangePassword(info.AccID, txtmk1.Text, txtmk2.Text))
             {
                 //thanh cong
                 MessageBox.Show("Đổi mật khẩu thành công");
             }
             else
             {
                 //that bai
                 MessageBox.Show("Đổi mật khẩu thất bại");
             }
         }
     }
     else
     {
         //Ngược Lại
         //Thông báo cho khách hàng
         MessageBox.Show("Hãy điền đủ thông tin");
     }
 }
Exemplo n.º 2
0
        //event
        //Đổi password
        private void bt_Change_Click(object sender, EventArgs e)
        {
            string notify  = "Bạn chắc chắn muốn đổi không";
            string caption = "Cảnh báo";

            if (txt_Password.Text == "")               // nếu ô text Password trống
            {
                MessageBox.Show("Chưa nhập password"); //thông báo
                return;                                // kết thúc chương trình
            }
            if (txt_NewPass.Text == "")                // nếu ô text New Passửod trống
            {
                MessageBox.Show("Chưa nhập password mới");
                return;
            }
            if (txt_CheckNewPass.Text == "")// nếu ô text Check New Password trống
            {
                MessageBox.Show("Chưa nhập lại password mới");
                return;
            }
            if (txt_NewPass.Text != txt_CheckNewPass.Text)// nếu nhập _CheckNewPass khác với newPass
            {
                MessageBox.Show("Nhập lại password mới không trùng với password mới");
                return;
            }
            if (txt_Password.Text != acc.Password)// nếu Password người dùng hiện tại nhập sai (Pass lúc này chưa đổi)
            {
                MessageBox.Show("Nhập sai password");
                return;
            }
            var result = MessageBox.Show(notify, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning); // hỏi xem có đổi không

            if (result == DialogResult.Yes)                                                                 // có thì đổi password
            {
                if (bal.ChangePassword(txt_NewPass.Text, acc.AccountID))                                    //đổi, nếu thành công thì thông báo thành công
                {
                    MessageBox.Show("Đổi thành công");
                }
                else
                {
                    MessageBox.Show("Đổi thất bại");// thất bại thì thông báo thất bại
                }
            }
        }
Exemplo n.º 3
0
 public async Task <Response> ChangePassword(Account account, string new_password)
 {
     return(await accountBal.ChangePassword(account, new_password));
 }