Esempio n. 1
0
        public string Create(string email, string id_customer, string password, string confirm_password)
        {
            account_dal.setAccount(email, id_customer, password, confirm_password, "khachhang");

            if (email == "" || password == "" || confirm_password == "")
            {
                return("Hãy điền đầy đủ thông tin !!!");
            }
            if (account_dal.Check_Exists_IdCustomer() == true)
            {
                return("Khách hàng này đã có tài khoản, xin hãy kiểm tra lại!!!");
            }
            if (account_dal.Check_Exists_Email() == true)
            {
                return("Email này đã có người sử dụng !!!");
            }
            if (IsValidEmail(email) == false)
            {
                return("Email không hợp lệ !!!");
            }
            if (password.Length < 6)
            {
                return("Mật khẩu phải có ít nhất 6 ký tự !!!");
            }
            if (confirm_password != password)
            {
                return("Mật khẩu nhập lại không khớp với mật khẩu đã nhập!!!");
            }
            account_dal.Create();
            return("Đã thêm thành công tài khoản !!!");
        }