public ActionResult MDlg(int id = 0) { ViewData["SORT"] = mBll.GetMaxSort(); if (id != 0) { Menu menu = mBll.Get(id); if (menu != null) { ViewBag.MenuName = menu.MenuName; ViewBag.MGId = menu.MGId; MenuGroup mg = mgBll.Get(id); ViewBag.MenuGroupName = mg != null ? mg.MGName : string.Empty; ViewData["SORT"] = menu.Sort; ViewBag.Icon = menu.Icon; ViewBag.Page = menu.Page; } } return(View("~/views/home/menu/mdlg.cshtml")); }