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 EngDetail(string id, string cdts, string keyWord, string newsClassId, string newsTypeId, int dataIndex = 0)
 {
     GetConditions(cdts);
     EntityCounter(id, "VisterENG");
     NewsModel entityModel = new NewsModel(id);
     if ("1".Equals(entityModel.IsOut) && !string.IsNullOrWhiteSpace(entityModel.AUrl))
     {
         Response.Redirect(entityModel.AUrl);
     }
     entityModel.GetPrevNextEntity(dataIndex, keyWord, newsClassId, newsTypeId);
     ViewData["DataIndex"] = dataIndex;
     ViewData["KeyWord"] = keyWord;
     ViewData["NewsClassId"] = newsClassId;
     ViewData["NewsTypeId"] = newsTypeId;
     return View(entityModel);
 }
        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");
        }
 public ActionResult SendMail(SendMailModel model, string id)
 {
     NewsModel entityModel = new NewsModel(id);
     string captcha = AccountUtil.GetCaptcha();
     if (!captcha.Equals(model.SendMailConfirmationCode, StringComparison.OrdinalIgnoreCase))
     {
         ModelState.AddModelError(string.Empty, "驗證碼錯誤");
     }
     else
     {
         model.SendMailTitle = string.Format("收到一封由【{0}】從產業永續發展整合資訊網的轉寄信:{1}。"
             , model.SendMailName, entityModel.Name);
         model.SendMailContent += entityModel.Content;
         model.SendMail();
         EntityCounter(id, "Emailer");
         ViewData["SendMailOk"] = true;
     }
     return View("Email", entityModel);
 }