Exemplo n.º 1
0
        public ActionResult Certificates(int managerId, CertificateAddModel addModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(addModel));
            }
            int userId = User.Identity.GetUserId <int>();

            // проверяем, владелец ли резюме шлет запрос на его изменение
            if (!_managerService.IsOwnedBy(userId, managerId))
            {
                return(new HttpUnauthorizedResult());
            }

            addModel.ResumeManagerId = managerId;
            _certificateService.CreateOrUpdate(addModel);

            return(RedirectToAction(string.Format("Certificates/{0}", managerId)));
        }