コード例 #1
0
        public ActionResult Register(CredentialModel credential)
        {
            var posCredential = credential.ToPosCredential();

            try
            {
                _userLogic.Register(posCredential);
            }
            catch (CommonException ex)
            {
                ViewBag.RegisterMessage = ex.Message;
                return(View("Login"));
            }

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult Login(CredentialModel credential)
        {
            var posCredential = credential.ToPosCredential();

            try
            {
                posCredential = _userLogic.Login(posCredential);
                _cache.Add <PosCredential>(SessionConstants.PosCredential, posCredential);
            }
            catch (CommonException ex)
            {
                ViewBag.ValidationMessage = ex.Message;
                return(View("Login"));
            }

            return(RedirectToAction("Index"));
        }