示例#1
0
        public ActionResult Create(T_User user)
        {
            if (ModelState.IsValid)
            {
                IResponse response = AreaBs.UserBs.Insert(user);
                TempData["Resp"] = response;

                return RedirectToAction("Index");
            }
            else
            {
                return View("Index");
            }
        }
示例#2
0
 public ActionResult SignIn(T_User user)
 {
     try
     {
         if (Membership.ValidateUser(user.UserEmail, user.Password))
         {
             FormsAuthentication.SetAuthCookie(user.UserEmail, false);
             return RedirectToAction("Index", "Home", new {area = "Common"});
         }
         else
         {
             TempData["Resp"] = new Response(true, new Msg("Login Failed"));
             return RedirectToAction("Index");
         }
     }
     catch (Exception e)
     {
         TempData["Resp"] = new Response(true, new Msg("Login Failed<BR>" + e.Message));
         return RedirectToAction("Index");
     }
 }