Esempio n. 1
0
        public ActionResult Login(User admin)
        {
            try
            {
                // TODO: Add insert logic here


                UserDBHandle udb = new UserDBHandle();
                if (udb.validateAdmin(admin) == true)
                {
                    ModelState.Clear();
                    Session["Firstname"] = admin.Firstname;
                    return(View("Dashboard"));
                }
                else
                {
                    ViewBag.Message = "Restricted Access";

                    ModelState.Clear();
                }

                return(View());
            }
            catch
            {
                return(View());
            }
        }
Esempio n. 2
0
        public ActionResult Login(User loginUser)
        {
            try
            {
                // TODO: Add insert logic here


                UserDBHandle udb = new UserDBHandle();
                if (udb.validateUser(loginUser) == true)
                {
                    ModelState.Clear();
                    return(RedirectToAction("Create", "Payment"));
                }
                else
                {
                    ViewBag.Message = "Invalid Credentials";
                }

                return(View());
            }
            catch
            {
                return(View());
            }
        }
Esempio n. 3
0
 public ActionResult Register(User user)
 {
     try
     {
         if (ModelState.IsValid)
         {
             UserDBHandle udb = new UserDBHandle();
             if (udb.AddUser(user))
             {
                 ViewBag.Message = "Your account has been created";
                 ModelState.Clear();
             }
         }
         return(View());
     }
     catch
     {
         return(View());
     }
 }