public List <string> GetAccessMaskFlag(AccessMask accessMask) { AccessMaskCollection accessMaskCollection = new AccessMaskCollection(); int accessFlag = context.AccessMask .Where(m => m.Name.Equals(accessMask.Name)) .Where(m => m.BoardId == accessMask.BoardId) .Select(m => m.AccessFlag) .SingleOrDefault(); return(accessMaskCollection.GetPairedMask(accessFlag)); }
public ActionResult Update(string maskName, int?boardIDnull) { int boardID = boardIDnull ?? 0; AccessMaskService ams = new AccessMaskService(); AccessMaskCollection amc = new AccessMaskCollection(); if (maskName == null || boardIDnull == null || ams.GetAccessMask(maskName, boardID) == null) { return(Redirect("~/ForumAdmin")); } AccessMask am = ams.GetAccessMask(maskName, boardID); ViewBag.activeMaskList = ams.GetAccessMaskFlag(am); ViewBag.accessFlag = am.AccessFlag; ViewBag.accessMaskID = ams.GetAccessMaskID(maskName, boardID); ViewBag.boardID = boardID; ViewBag.maskName = maskName; return(View()); }