Example #1
0
        public ActionResult List()
        {
            List <MenuViewModel> menu = new List <MenuViewModel>(
                MenuRepo.All()
                );

            foreach (var item in menu)
            {
                item.ParentName = MenuRepo.getParentName(item.menu_parent == null ? 0 : (long)item.menu_parent);
            }
            return(PartialView("_List", menu));
        }
Example #2
0
        public ActionResult Edit(MenuViewModel model)
        {
            var userid = (long)Session["userid"];

            ViewBag.ListMenu = new SelectList(MenuRepo.All(null), "id", "title");//untuk dropdownlist
            ResponResultViewModel result = MenuRepo.Update(model, userid);

            return(Json(new
            {
                success = result.Success,
                message = result.Message,
                entity = result.Entity
            }, JsonRequestBehavior.AllowGet));
        }
Example #3
0
 public ActionResult Edit(long id)
 {
     ViewBag.MenuList = new SelectList(MenuRepo.All(), "id", "title");
     return(PartialView("_Edit", MenuRepo.ById(id)));
 }
Example #4
0
 public ActionResult Create()
 {
     ViewBag.MenuList = new SelectList(MenuRepo.All(), "id", "title");
     return(PartialView("_Create"));
 }
Example #5
0
 //Edit
 public ActionResult Edit(int id)
 {
     ViewBag.ListMenu = new SelectList(MenuRepo.All(null), "id", "title");//untuk dropdownlist
     return(PartialView("_Edit", MenuRepo.GetMenu(id)));
 }
Example #6
0
 //Create
 public ActionResult Create()
 {
     ViewBag.ListMenu = new SelectList(MenuRepo.All(null), "id", "title");//untuk dropdownlist
     return(PartialView("_Create"));
 }
Example #7
0
 // List
 public ActionResult List(string search)
 {
     return(PartialView("_List", MenuRepo.All(search)));
 }
Example #8
0
 // GET: Menu
 public ActionResult Index(string search)
 {
     return(View(MenuRepo.All(search)));
 }
 public ActionResult ListMenu()
 {
     return(PartialView("_ListMenu", MenuRepo.All()));
 }