コード例 #1
0
        public ActionResult Login(string Username, string Password)
        {
            try {
                var staff = _staffService.GetByID(Username, Password);
                AppHelper.AddStaffToCache(staff);

                FormsAuthentication.SetAuthCookie(staff.StaffNo, false);
                return(RedirectToAction("Index", "Staff"));
            }
            catch (Exception) {
                return(View(Username, Password));
            }
        }