Exemple #1
0
        public bool ValidateUser(Model.User u)
        {
            bool status = false;

            if (u.Uname != null & u.Upassword.Length >= 8)
            {
                DAO.User d1 = new DAO.User();
                if (!d1.CheckUser(u))
                {
                    d1.Insert(u);
                    status = true;
                }
            }
            else
            {
                status = false;
            }
            return(status);
        }
Exemple #2
0
        public Model.User UserLoginValidation(string username, string password)
        {
            HttpContext context = HttpContext.Current;

            DAO.User   d = new DAO.User();
            Model.User u = d.UserLogin(username);
            if (u.Upassword != null)
            {
                if (password.Equals(EncryptionDecryption.DecodeFrom64(u.Upassword)))
                {
                    return(u);
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }