Exemplo n.º 1
0
        public bool AddSideToCategory(int menuCategoryId, bool isDeleted, bool isActive, SideFilterVM sideVM)
        {
            bool isSuccess = false;
            side side = sideVM.FirstOrDefault();

            side.menu_category = db.menu_category.Find(menuCategoryId);
            side.is_deleted = isDeleted;
            side.is_active = isActive;

            if (side.name != "" && menuCategoryId != 0)
            {
                db.sides.Add(side);
                db.SaveChanges();
                isSuccess = true;
            }

            if (isSuccess)
            {
                HttpContext.Session["message"] = side.name + " successfuly added.";
            }
            else
            {
                HttpContext.Session["error"] = side.name + " could not be added.";
            }

            return false;
        }
Exemplo n.º 2
0
 public PartialViewResult FilterSides(menu_category menu_cat)
 {
     SideFilterVM iFilter = new SideFilterVM(menu_cat, SideUtil.FilterListBySide(menu_cat)); //(menu_cat, SideUtil.FilterListBySide(menu_cat));
     return PartialView("_SideTable", iFilter);
 }
Exemplo n.º 3
0
 public ActionResult CreatePartial(int cat_id)
 {
     SideFilterVM sideFilter = new SideFilterVM();
     menu_category c = db.menu_category.Find(cat_id);
     sideFilter.menu_cat = c;
     sideFilter.AddSide(new side());
     return PartialView("_SideCreate", sideFilter);
 }