예제 #1
0
        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");
            }
        }
예제 #2
0
        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);
            }
        }