Ejemplo n.º 1
0
        public ActionResult Login(Academy academy)
        {
            response.status = false;
            if (academy != null)
            {
                try{
                    Academy academySession = db.FindAcademy(academy);
                    if (academySession != null)
                    {
                        Session["Academy"] = academySession;
                        response.status    = true;
                    }
                    else
                    {
                        throw new Exception("Academy not found. Check your email and password and try again.");
                    }
                }
                catch (Exception ex) {
                    string error = ex.Message;
                    response.message = error;
                }
            }

            return(Json(new { status = response.status, message = response.message }, JsonRequestBehavior.AllowGet));
        }