Exemplo n.º 1
0
        public ActionResult Details(int id)
        {
            try
            {
                LogBLL.Insert(new LogDado("Details()", "Area", _idUsuario));
                using (Context db = new Context())
                {
                    BLL.AreaBLL areaBLL = new BLL.AreaBLL(db, _idUsuario);
                    Area area = areaBLL.FindSingle(e => e.idArea == id, i => i.Modulo);

                    return View(RP.Sistema.Web.Models.Area.AreaVM.E2VM(area));
                }
            }
            catch (Exception ex)
            {
                this.AddFlashMessage(RP.Util.Exception.Message.Get(ex), FlashMessage.ERROR); RP.Util.Entity.ErroLog.Add(ex, Session.SessionID, _idUsuario); RP.Util.Entity.ErroLog.Add(ex, Session.SessionID, _idUsuario);
                return RedirectToAction("Index");
            }
        }
Exemplo n.º 2
0
        public JsonResult JsDetails(int idArea)
        {
            try
            {
                using (Context db = new Context())
                {
                    BLL.AreaBLL areaBLL = new BLL.AreaBLL(db, _idUsuario);
                    Area area = areaBLL.FindSingle(e => e.idArea == idArea, i => i.Modulo);

                    if (area == null)
                    {
                        return Json(string.Empty, JsonRequestBehavior.AllowGet);
                    }

                    var result = new
                    {
                        area.idArea,
                        area.nmArea,
                        area.dsArea
                    };

                    return Json(result, JsonRequestBehavior.AllowGet);
                }
            }
            catch (Exception ex)
            {
                Response.StatusCode = 500;
                return Json(RP.Util.Exception.Message.Get(ex), JsonRequestBehavior.AllowGet);
            }
        }