Exemple #1
0
        public string ChangePasswordVeri(ChangePassword model)
        {
            Md5Function md5     = new Md5Function();
            Account     acc     = new ModifyAccount().Select(model.username);
            string      oldpass = md5.MD5HashFunction(model.oldPassword);

            if (oldpass == acc.password.Split(' ')[0])
            {
                string        newpass = md5.MD5HashFunction(model.newPassword);
                ModifyAccount ma      = new ModifyAccount();
                ma.UpdatePasswordChange(model.username, newpass);
                return("true");
            }
            else
            {
                return("false");
            }
        }
        public string VerifyLogin(LoginModel model)
        {
            Md5Function md5  = new Md5Function();
            string      pass = md5.MD5HashFunction(model.passWord);

            if (!new ModifyAccount().CheckUsername(model.userName))
            {
                return("Tài khoản không tồn tại");
            }
            else
            {
                string s = new ModifyAccount().CheckAccount(model.userName, pass);
                if (s == "false")
                {
                    return("Sai mật khẩu");
                }
                else
                {
                    return(s);
                }
            }
        }