示例#1
0
        public ActionResult EditIntroduction(Introduction introduction)
        {
            if (introduction == null)
            {
                SetFailedNotification("Có lỗi xảy ra. Vui lòng thử lại");
                return(RedirectToAction("Index"));
            }

            if (!ModelState.IsValid)
            {
                foreach (var item in ModelState.Values)
                {
                    SetFailedNotification(item.Value.ToString());
                }
                return(View("EditIntroduction", introduction));
            }

            if (_layoutRepository.SaveIntroduction(introduction))
            {
                SetSuccessNotification("Cập nhật thông tin công ty thành công");
            }
            else
            {
                SetFailedNotification("Cập nhật thông tin không thành công. Xin thử lại");
            }

            return(RedirectToAction("Introduction", "Home"));
        }