public ActionResult ChooseSNRuleBlock(string id) { SNRule snRule = base.genericMgr.FindById <SNRule>(int.Parse(id)); ViewBag.BlockSeq = snRule.BlockSeq; ViewBag.Id = id; return(PartialView()); }
//[SconitAuthorize(Permission = "Url_SNRule_Edit")] public ActionResult Edit(string Code, string YearCode, string MonthCode, string DayCode, string SeqLength, string BlockSeq) { SNRule snRule = base.genericMgr.FindById <SNRule>(int.Parse(Code)); snRule.YearCode = YearCode; snRule.MonthCode = MonthCode; snRule.DayCode = DayCode; snRule.SeqLength = Int16.Parse(SeqLength); snRule.BlockSeq = BlockSeq; base.genericMgr.Update(snRule); return(RedirectToAction("List")); }
// [SconitAuthorize(Permission = "Url_SNRule_Edit")] public ActionResult Edit(string id) { string addedItems = ""; string removedItems = ""; if (string.IsNullOrEmpty(id)) { return(HttpNotFound()); } else { IList <char> ChoosedBlockList = (IList <char>)TempData["ChoosedBlockList"]; IList <char> UnChoosedBlockList = (IList <char>)TempData["UnChoosedBlockList"]; SNRule snRule = base.genericMgr.FindById <SNRule>(int.Parse(id)); foreach (var item in ChoosedBlockList) { if (!snRule.BlockSeq.Contains(item)) { addedItems = addedItems + item.ToString(); } } foreach (var item in UnChoosedBlockList) { if (snRule.BlockSeq.Contains(item)) { removedItems = removedItems + item.ToString(); } } TempData["ChoosedBlockList"] = ChoosedBlockList; TempData["UnChoosedBlockList"] = UnChoosedBlockList; ViewBag.AddedItems = addedItems; ViewBag.RemovedItems = removedItems; return(PartialView(snRule)); } }