Пример #1
0
        public ActionResult EditFooter(Footer footer)
        {
            SetPageTitle("Cấu hình footer");

            if (footer == 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(footer));
            }

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

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