private void Guardar(bool nuevoRegistro, int id, string desc, string siglas) { try { RR_TipoEventoAgenda Datos = new RR_TipoEventoAgenda { NuevoRegistro = nuevoRegistro, IDTipoEventoAgenda = id, Descripcion = desc, Siglas = siglas, Conexion = Comun.Conexion, IDUsuario = Comun.IDUsuario }; RR_CatalogosNegocio CN = new RR_CatalogosNegocio(); CN.ACCatalogoTipoEventoAgenda(Datos); if (Datos.Completado) { Response.Redirect("frmTipoEventoAgendaGrid.aspx", false); } else { string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al guardar los datos.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true); } } catch (Exception ex) { throw ex; } }
private void CargarComboActividad() { RR_TipoEventoAgenda Datos = new RR_TipoEventoAgenda() { Conexion = Comun.Conexion }; RR_CatalogosNegocio GN = new RR_CatalogosNegocio(); ListaEventoAgenda = GN.ObtenerCatalogoActividad(Datos); }
public List <RR_TipoEventoAgenda> ObtenerCatalogoActividad(RR_TipoEventoAgenda Datos) { try { RR_CatalogoDatos CD = new RR_CatalogoDatos(); return(CD.ObtenerCatalogoActividad(Datos)); } catch (Exception ex) { throw ex; } }
public void EliminarTipoEventoAgendaXID(RR_TipoEventoAgenda Datos) { try { RR_CatalogoDatos CD = new RR_CatalogoDatos(); CD.EliminarTipoEventoAgendaXID(Datos); } catch (Exception ex) { throw ex; } }
public void ObtenerDetalleTipoEventoAgendaXID(RR_TipoEventoAgenda Datos) { try { RR_CatalogoDatos CD = new RR_CatalogoDatos(); CD.ObtenerDetalleTipoEventoAgendaXID(Datos); } catch (Exception ex) { throw ex; } }
public void ACCatalogoTipoEventoAgenda(RR_TipoEventoAgenda Datos) { try { RR_CatalogoDatos CD = new RR_CatalogoDatos(); CD.ACCatalogoTipoEventoAgenda(Datos); } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { try { if (Request.QueryString["op"] != null && Request.QueryString["op"] == "3") { if (Request.QueryString["id"] != null) { int AuxID = 0; int.TryParse(Request.QueryString["id"], out AuxID); RR_TipoEventoAgenda Datos = new RR_TipoEventoAgenda { Conexion = Comun.Conexion, IDTipoEventoAgenda = AuxID, IDUsuario = Comun.IDUsuario }; RR_CatalogosNegocio CN = new RR_CatalogosNegocio(); CN.EliminarTipoEventoAgendaXID(Datos); if (Datos.Completado) { string ScriptError = DialogMessage.Show(TipoMensaje.Success, "Registro eliminado correctamente.", "Información", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true); } else { string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al eliminar el registro.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true); } } } if (!IsPostBack) { } else { } this.CargarGrid(); if (Request.QueryString["errorMessage"] != null) { string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al cargar los datos. Intenté nuevamente", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true); } } catch (Exception ex) { Response.Redirect("PageError.aspx?errorNumber=" + ex.HResult); } }
private void CargarDatos(RR_TipoEventoAgenda DatosAux) { try { //BasicCrypto BC = new BasicCrypto(); //hf.Value = BC.Encripta(DatosAux.IDGenero.ToString()); hf.Value = DatosAux.IDTipoEventoAgenda.ToString(); txtDescripcion.Value = DatosAux.Descripcion.ToString(); txtSiglas.Value = DatosAux.Siglas.ToString(); } catch (Exception ex) { throw ex; } }
public void CargarGrid() { try { RR_TipoEventoAgenda Datos = new RR_TipoEventoAgenda() { Conexion = Comun.Conexion }; RR_CatalogosNegocio GN = new RR_CatalogosNegocio(); Lista = GN.ObtenerCatalogoTipoEventoAgenda(Datos); } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //Se inicializan campos, datos, valores if (Request.QueryString["op"] != null) { if (Request.QueryString["op"] == "2") { if (Request.QueryString["id"] != null) { int ID = 0; if (int.TryParse(Request.QueryString["id"].ToString(), out ID)) { //Obtener los datos y dibujarlos. RR_TipoEventoAgenda DatosAux = new RR_TipoEventoAgenda() { Conexion = Comun.Conexion, IDTipoEventoAgenda = ID }; RR_CatalogosNegocio CN = new RR_CatalogosNegocio(); CN.ObtenerDetalleTipoEventoAgendaXID(DatosAux); if (DatosAux.Completado) { this.CargarDatos(DatosAux); } else { //Ocurrió un error Response.Redirect("frmTipoEventoAgendaGrid.aspx?errorMessage=" + DatosAux.Resultado); } } else { Response.Redirect("frmTipoEventoAgendaGrid.aspx?errorMessage=1"); } } else { Response.Redirect("frmTipoEventoAgendaGrid.aspx?errorMessage=2"); } } else { Response.Redirect("frmTipoEventoAgendaGrid.aspx?errorMessage=3"); } } else { this.IniciarDatos(); } } else { //Page.Validate(); //if (IsValid) //{ if (Request.Form.Count == 7) { string txtDescripcion = Request.Form["ctl00$cph_MasterBody$txtDescripcion"].ToString(); string txtSiglas = Request.Form["ctl00$cph_MasterBody$txtSiglas"].ToString(); int IDGradoEstudios = -1; try { //BasicCrypto BC = new BasicCrypto(); //string AuxID = BC.Desencripta(Request.Form["ctl00$cph_MasterBody$hf"].ToString()); string AuxID = Request.Form["ctl00$cph_MasterBody$hf"].ToString(); int.TryParse(AuxID, out IDGradoEstudios); bool NuevoRegistro = !(IDGradoEstudios > 0); this.Guardar(NuevoRegistro, IDGradoEstudios, txtDescripcion, txtSiglas); } catch (Exception ex) { Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message); } //} } } }