public ActionResult MenusGridPartial() { res1.DataList = API_MenuDriver.GetAllMenus().DataList; if (Session[SessionNames.MenuLayout] != null) { API_RefOptions.SaveGridLayout(new GridLayout("MenuDriver", 0, (string)Session[SessionNames.MenuLayout])); } else { Session[SessionNames.MenuLayout] = API_RefOptions.GetSavedGridLayout("MenuDriver", 0).ToString(); } return(PartialView("_MenusGridPartial", res1)); }
private Response <Menus> SaveMenu(Menus value, FormCollection collection) { value.MnuIconVerySmall = value.MnuIconSmall = value.MnuIconMedium = value.MnuIconLarge = new byte[] { }; HttpPostedFileBase fileVerySmall = Request.Files["fuIconVerySmall"]; HttpPostedFileBase fileSmall = Request.Files["fuIconSmall"]; HttpPostedFileBase fileMedium = Request.Files["fuIconMedium"]; HttpPostedFileBase fileLarge = Request.Files["fuIconLarge"]; if (fileVerySmall != null && fileVerySmall.ContentLength > 0) { using (var binaryReader = new BinaryReader(fileVerySmall.InputStream)) { value.MnuIconVerySmall = binaryReader.ReadBytes(fileVerySmall.ContentLength); } } if (fileSmall != null && fileSmall.ContentLength > 0) { using (var binaryReader = new BinaryReader(fileSmall.InputStream)) { value.MnuIconSmall = binaryReader.ReadBytes(fileSmall.ContentLength); } } if (fileMedium != null && fileMedium.ContentLength > 0) { using (var binaryReader = new BinaryReader(fileMedium.InputStream)) { value.MnuIconMedium = binaryReader.ReadBytes(fileMedium.ContentLength); } } if (fileLarge != null && fileLarge.ContentLength > 0) { using (var binaryReader = new BinaryReader(fileLarge.InputStream)) { value.MnuIconLarge = binaryReader.ReadBytes(fileLarge.ContentLength); } } return(API_MenuDriver.SaveMenu(value)); }
public ActionResult Edit(int Id) { res = API_MenuDriver.GetMenuDetails(Id); if (res.Data != null) { if (res.Data.LstIconLarge != null) { res.Data.MnuIconLarge = res.Data.LstIconLarge.ToArray(); } if (res.Data.LstIconMedium != null) { res.Data.MnuIconMedium = res.Data.LstIconMedium.ToArray(); } if (res.Data.LstIconSmall != null) { res.Data.MnuIconSmall = res.Data.LstIconSmall.ToArray(); } if (res.Data.LstIconVerySmall != null) { res.Data.MnuIconVerySmall = res.Data.LstIconVerySmall.ToArray(); } } return(View(res)); }
public ActionResult Create() { res = new Response <Menus>(); res = API_MenuDriver.GetMenuDetails(0); return(View(res)); }
public ActionResult Delete(int Id) { res = API_MenuDriver.RemoveMenu(Id); return(RedirectToAction("Index")); }