예제 #1
0
        public ActionResult Edit(Employee employee, HttpPostedFileBase image)
        {
            if (ModelState.IsValid)
            {
                employee.UpdateFileForContainer(image);

                _repository.UpdateEmployee(employee);
                TempData.AddMessage(MessageType.Success, string.Format(GlobalRes.EmployeeSavedMsg, employee.FullName));
                _logger.Info("Employee \"{0}\" saved by {1}.", employee.FullName, User.Identity.Name);

                return RedirectToAction(nameof(Table), new { area = "Admin" });
            } else
            {
                // there is something wrong with the data values
                return View("EditEmployee", employee);
            }
        }