public SelectList MenuPath2_SelectList_FilteredFor(MenuPath1ENUM menuPath1Enum) { var allMenuPathMainsForMp1Lst = FindAllMenuPathMainsFor(menuPath1Enum) .ToList(); if (allMenuPathMainsForMp1Lst.IsNull()) { return(new SelectList(null)); } HashSet <string> hashMp2Id = new HashSet <string>(); foreach (MenuPathMain mpm in allMenuPathMainsForMp1Lst) { hashMp2Id.Add(mpm.MenuPath2Id); } if (hashMp2Id.IsNullOrEmpty()) { return(new SelectList(null)); } List <MenuPath2> Mp2Lst = new List <MenuPath2>(); foreach (var mp2Id in hashMp2Id) { MenuPath2 mp2 = _menupath2Biz.Find(mp2Id); mp2.IsNullThrowException(); Mp2Lst.Add(mp2); } SelectList selectList = _menupath2Biz.SelectList_Engine(Mp2Lst.AsQueryable()); return(selectList); }
public IQueryable <MenuPathMain> FindAllMenuPathMainsFor(MenuPath1ENUM menuPath1Enum) { var allMenuPaths = FindAll(); allMenuPaths = allMenuPaths.Where(x => x.MenuPath1.MenuPath1Enum == menuPath1Enum); return(allMenuPaths); }
public MenuPath1ENUM ChangeToEnum(MenuPath1 mp1) { string spacesRemovedName = mp1.Name.RemoveAllSpaces(); try { MenuPath1ENUM mp1Enum = (MenuPath1ENUM)Enum.Parse(typeof(MenuPath1ENUM), spacesRemovedName, true); return(mp1Enum); } catch (ArgumentException a) { ErrorsGlobal.Add(string.Format("Unable to convert the enum: '{0}'", spacesRemovedName), MethodBase.GetCurrentMethod(), a); throw new ArgumentException(ErrorsGlobal.ToString()); } catch (Exception e) { ErrorsGlobal.Add(string.Format("Error converting enum: '{0}'", spacesRemovedName), MethodBase.GetCurrentMethod(), e); throw new Exception(ErrorsGlobal.ToString()); } }
public SelectList MenuPath2_SelectList_FilteredFor(MenuPath1ENUM menuPath1Enum) { return(MenuPathMainBiz.MenuPath2_SelectList_FilteredFor(menuPath1Enum)); }
public MenuPath1 FindByMenuPath1EnumFor(MenuPath1ENUM menuPath1Enum) { MenuPath1 mp1 = FindAll().FirstOrDefault(x => x.MenuPath1Enum == menuPath1Enum); return(mp1); }