예제 #1
0
        public ActionResult Add(int id, string content)
        {
            try
            {
                if (id == 0)
                {
                    footerRepository.Add(content);
                }
                else
                {
                    Footer footer = new Footer();
                    footer.ID       = id;
                    footer.Contents = content;
                    footerRepository.Edit(footer);
                }

                return(Json(new { IsSuccess = true, Message = "Lưu thành công" }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(new { IsSuccess = false, Message = "Lưu thất bại" }, JsonRequestBehavior.AllowGet));
            }
        }