Beispiel #1
0
 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));
 }
Beispiel #2
0
        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));
        }
Beispiel #3
0
 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));
 }
Beispiel #4
0
 public ActionResult Create()
 {
     res = new Response <Menus>();
     res = API_MenuDriver.GetMenuDetails(0);
     return(View(res));
 }
Beispiel #5
0
 public ActionResult Delete(int Id)
 {
     res = API_MenuDriver.RemoveMenu(Id);
     return(RedirectToAction("Index"));
 }