public ActionResult Edit(ReportModel model, string cdts)
        {
            GetConditions(cdts);

            ModelState.Remove("Name");
            ModelState.Remove("ConfirmationCode");
            if (!model.IsValid(ModelState))
            {
                return(View("Save", model));
            }

            ////檢查內容無障礙是否通過
            if (!AccessibilityUtil.CheckFreeGO(model.Content))
            {
                model.ShowFreeGOMsg    = true;
                model.FreeGOColumnName = "Content";
            }

            model.Update();

            if (model.ShowFreeGOMsg)
            {
                return(View("Save", model));
            }

            return(RedirectToAction("AdminIndex", new { Page = model.Page, Cdts = cdts }));
        }
        public ActionResult Create(ReportModel model, string cdts)
        {
            GetConditions(cdts);

            ModelState.Remove("Name");
            ModelState.Remove("ConfirmationCode");
            if (!model.IsValid(ModelState))
            {
                return(View("Save", model));
            }

            ////檢查內容無障礙是否通過
            if (!AccessibilityUtil.CheckFreeGO(model.Content))
            {
                model.ShowFreeGOMsg    = true;
                model.FreeGOColumnName = "Content";
            }

            model.Insert();

            if (model.ShowFreeGOMsg)
            {
                return(View("Save", model));
            }

            return(View("AdminIndex"));
        }
        public ActionResult Edit(NewsModel model, string cdts)
        {
            GetConditions(cdts);

            ////檢查內容無障礙是否通過
            if (!AccessibilityUtil.CheckFreeGO(model.Content))
            {
                model.ShowFreeGOMsg    = true;
                model.FreeGOColumnName = "Content";
            }
            else if (!AccessibilityUtil.CheckFreeGO(model.ContentENG))
            {
                model.ShowFreeGOMsg    = true;
                model.FreeGOColumnName = "ContentENG";
            }

            model.Update();

            if (model.ShowFreeGOMsg)
            {
                return(View("Save", model));
            }

            return(RedirectToAction("AdminIndex", new { Page = model.Page, Cdts = cdts }));
        }
        public ActionResult Create(NewsModel model, string cdts)
        {
            GetConditions(cdts);

            ////檢查內容無障礙是否通過
            if (!AccessibilityUtil.CheckFreeGO(model.Content))
            {
                model.ShowFreeGOMsg    = true;
                model.FreeGOColumnName = "Content";
            }
            else if (!AccessibilityUtil.CheckFreeGO(model.ContentENG))
            {
                model.ShowFreeGOMsg    = true;
                model.FreeGOColumnName = "ContentENG";
            }

            model.Insert();

            if (model.ShowFreeGOMsg)
            {
                return(View("Save", model));
            }

            return(View("AdminIndex"));
        }
Esempio n. 5
0
        public ActionResult NodeSingleEdit(NodeModel model)
        {
            ////檢查內容無障礙是否通過
            if (!AccessibilityUtil.CheckFreeGO(model.Content))
            {
                model.ShowFreeGOMsg    = true;
                model.FreeGOColumnName = "Content";
            }

            model.Update();
            return(View(model));
        }
        public ActionResult Edit(DownloadModel model, string cdts)
        {
            GetConditions(cdts);

            ////檢查內容無障礙是否通過
            if (!AccessibilityUtil.CheckFreeGO(model.Content))
            {
                model.ShowFreeGOMsg    = true;
                model.FreeGOColumnName = "Content";
            }

            model.Update();

            if (model.ShowFreeGOMsg)
            {
                return(View("Save", model));
            }

            return(View("AdminIndex"));
        }