public JQGrid ListarPersonas(FiltroPersona objFiltroPersona) { JQGrid objJQGrid = new JQGrid(); List <Persona> lst = new List <Persona>(); try { lst = LlenarListaPersonas(objFiltroPersona); List <string> lstCampos = new List <string>(); lstCampos.Add("iCodPer"); lstCampos.Add("vNomPer"); lstCampos.Add("vApePat"); lstCampos.Add("vApeMat"); lstCampos.Add("iNumTelefonico"); lstCampos.Add("vSexo"); lstCampos.Add("vArea"); lstCampos.Add("sdFecha"); objJQGrid = SAT.Libreria.JavaScript.JQuery.ListJQGrid <Persona>(lst, lstCampos, TipoAdministracionPaginacion.PorClase); return(objJQGrid); } catch (WebException e) { Excepcion excepcion = new Excepcion(); excepcion = ExcepcionWeb.ProcesarExcepcion(e); throw new Exception(excepcion.Identificador + ": " + excepcion.Description); } catch { throw; } }
protected override void OnException(ExceptionContext ExceptionContext_) { base.OnException(ExceptionContext_); var EsAjax = ExceptionContext_.RequestContext.HttpContext.Request.Headers["X-Requested-With"] == "XMLHttpRequest"; if (EsAjax) { return; } var Exception_ = ExceptionContext_.Exception.GetBaseExcepcion(); Response.Clear(); var HttpError = Exception_ as HttpException; var Error_ = new ExcepcionWeb(); var UrlOrigen = ExceptionContext_.RequestContext.HttpContext.Request.Url != null ? ExceptionContext_.RequestContext.HttpContext.Request.Url.AbsolutePath : ""; if (HttpError != null) { var Codigo = HttpError.GetHttpCode(); var Mensaje = HttpError.Message; Error_.Codigo = Codigo; Error_.Url = UrlOrigen; Error_.Mensaje = Mensaje; } else { Error_.Codigo = 0; Error_.Url = UrlOrigen; if (Exception_ != null) { Error_.Mensaje = Exception_.Message; } } Session["ErrorException"] = Error_; Server.ClearError(); if (!Response.IsRequestBeingRedirected) { Response.Redirect(@"/Home/Error"); } }
public void RegistrarPersonas(Persona persona) { try { int iCodPer = listaPersona.Lista.Count() + 1; persona.iCodPer = iCodPer; listaPersona.Lista.Add(persona); } catch (WebException e) { Excepcion excepcion = new Excepcion(); excepcion = ExcepcionWeb.ProcesarExcepcion(e); throw new Exception(excepcion.Identificador + ": " + excepcion.Description); } catch { throw; } }