Пример #1
0
        public ActionResult Login(UserModels userm)
        {
            IBusinessAuthentication iau = GenericFactory<BusinessLayer, IBusinessAuthentication>.CreateInstance();
            try
            {
                string chkAcctNum = iau.IsValidUser(Utils.StripPunctuation(userm.UserName),
                    Utils.StripPunctuation(userm.Password));
                //  string chkAcctNum = iau.IsValidUser(txtUsername.Text,
                //      txtPassword.Text);

                if (chkAcctNum != "")
                {
                    userm.AuthStat = "Welcome User";
                    SessionFacade.USERNAME = userm.UserName;
                    SessionFacade.CHECKINGACCTNUM = chkAcctNum;
                    if (SessionFacade.PAGEREQUESTED != null)
                        Response.Redirect(SessionFacade.PAGEREQUESTED);
                }
                else
                {
                    userm.AuthStat = "Invalid User";
                    //return View(userm);
                }
            }
            catch (Exception ex)
            {
                userm.AuthStat = ex.Message;
            }

            //ViewBag.Message = "Login page.";
            //return RedirectToAction("Login", "Home");
            return View(userm);
        }
Пример #2
0
 public ActionResult Login()
 {
     ViewBag.Message = "Login page.";
     UserModels userm = new UserModels();
     userm.AuthStat = "Please login.";
     return View(userm);
 }