예제 #1
0
        public ActionResult Login(User user)
        {
            /*if (!ModelState.IsValid)
             * {
             *  return View(user);
             * }*/

            BusinessLayerObjects obj = new BusinessLayerObjects();
            User objReturnedUser     = obj.GetUserDetail(user);

            if (objReturnedUser != null)
            {
                Session["UserId"]       = objReturnedUser.UserId;
                Session["FirstName"]    = objReturnedUser.FirstName;
                Session["LastName"]     = objReturnedUser.LastName;
                Session["EmailId"]      = objReturnedUser.EmailId;
                Session["UserType"]     = objReturnedUser.UserType;
                Session["Active"]       = objReturnedUser.Active;
                Session["ValidUser"]    = true;
                Session["UserTypeDesc"] = objReturnedUser.UserTypeDesc;

                return(RedirectToAction("Index", "Ticket"));
            }
            else
            {
                ModelState.AddModelError("", "Invalid login attempt.");
                return(View(user));
            }
        }
예제 #2
0
        public ActionResult UserProfile(string userId)
        {
            BusinessLayerObjects obj = new BusinessLayerObjects();
            User objUser             = obj.GetUserDetail(userId);

            return(View(objUser));
        }