Пример #1
0
        public ActionResult Login(LoginModel data)
        {
            IWorkerRepository workerRepository = new WorkerRepository();
            bool workerExist = workerRepository.LogIn(data.Login, data.Password);


            if (ModelState.IsValid && workerExist != false)
            {
                string cookieValue = data.Login.ToString();
                var    cookie      = new HttpCookie("LogOn", cookieValue);
                Response.AppendCookie(cookie);
                return(RedirectToAction("OrderList", "Order"));
            }
            else
            {
                return(View());
            }
        }