public ActionResult Details(int id) { try { using (Context db = new Context()) { BLL.MenuBLL menuBLL = new BLL.MenuBLL(db, _idUsuario); Menu menu = menuBLL.FindSingle(e => e.idMenu == id); return View(RP.Sistema.Web.Models.Menu.MenuVM.E2VM(menu)); } } catch (Exception ex) { this.AddFlashMessage(RP.Util.Exception.Message.Get(ex), FlashMessage.ERROR); RP.Util.Entity.ErroLog.Add(ex, Session.SessionID, _idUsuario); return RedirectToAction("Index"); } }
public JsonResult JsDetails(int idMenu) { try { using (Context db = new Context()) { BLL.MenuBLL menuBLL = new BLL.MenuBLL(db, _idUsuario); Menu menu = menuBLL.FindSingle(e => e.idMenu == idMenu); if (menu == null) { return Json(string.Empty, JsonRequestBehavior.AllowGet); } var result = new { menu.idMenu, menu.nmMenu, }; return Json(result, JsonRequestBehavior.AllowGet); } } catch (Exception ex) { Response.StatusCode = 500; return Json(RP.Util.Exception.Message.Get(ex), JsonRequestBehavior.AllowGet); } }