public ActionResult Detail(string id, string parentId) { string pId = DecryptId(parentId); SetConditions(string.Empty, string.Empty, pId); m_Conditions.Add("Status", "1"); IList <Norm> normList = GetGridData().ToList(); ViewData["NormList"] = normList; if (!string.IsNullOrWhiteSpace(parentId)) { NormClass normClass = m_FTISService.GetNormClassById(int.Parse(pId)); ViewData["NormClass"] = normClass; } NormModel model = new NormModel(); if (!string.IsNullOrWhiteSpace(id)) { model = new NormModel(id); } else { if (normList != null && normList.Count > 0) { model = new NormModel(normList[0].NormId); } } return(View(model)); }
public ActionResult Edit(NormModel 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(RedirectToAction("AdminIndex", new { Page = model.Page, Cdts = cdts })); }
public ActionResult Create(NormModel model, string cdts) { GetConditions(cdts); ////檢查內容無障礙是否通過 if (!AccessibilityUtil.CheckFreeGO(model.Content)) { model.ShowFreeGOMsg = true; model.FreeGOColumnName = "Content"; } model.Insert(); if (model.ShowFreeGOMsg) { return(View("Save", model)); } return(View("AdminIndex")); }