コード例 #1
0
 public ActionResult Index(loginModel model)
 {
     if (ModelState.IsValid)
     {
         if (DataAccess.DAL.UserIsValid(model.Username, model.Password))
         {
             FormsAuthentication.SetAuthCookie(model.Username, false);
             if (DataAccess.DAL.Position("manager", model.Username))
             {
                 return(RedirectToAction("index", "Calendar"));
             }
             else
             {
                 return(RedirectToAction("index", "User"));
             }
         }
         {
             ModelState.AddModelError("", "invalid username or password");
         }
     }
     return(View());
 }
コード例 #2
0
 public ActionResult Index(loginModel model)
 {
     return(View());
 }