Exemple #1
0
        public Dictionary<string, List<string>> signUp()
        {
            validateAccount va = new validateAccount(this.accountController.Request.Form);

            if (this.signUpClosed())
            {
                Dictionary<string, List<string>> errors = new Dictionary<string, List<string>>();
                errors.Add("Sign Up Closed", new List<string> { "Sign Up Closed Temporarily" });
                return errors;
            }

            if (va.validateSignUp().Count > 0)
                return va.validateSignUp();

            this.insertUser();

            return null;
        }
Exemple #2
0
        public Dictionary<string, List<string>> Login()
        {
            validateAccount va = new validateAccount(this.accountController.Request.Form);
            if (va.validateLogin().Count > 0)
                return va.validateLogin();

            extreemtEntities db = new extreemtEntities();
            int userId = int.Parse(this.accountController.Request.Form["id"]);
            string password = this.accountController.Request.Form["password"];
            if (db.users.Where(u => u.userId == userId && u.loginPassword == password).Count() <= 0)
            {
                Dictionary<string, List<string>> errors = new Dictionary<string, List<string>>();
                errors.Add("id", new List<string>() { "<p>Id or password may wrong</p>" });
                return errors;
            }
            return null;
        }