private void Guardar(bool nuevoRegistro, int id, string desc) { try { RR_GradoEstudios Datos = new RR_GradoEstudios { NuevoRegistro = nuevoRegistro, IDGradoEstudios = id, Descripcion = desc, Conexion = Comun.Conexion, IDUsuario = Comun.IDUsuario }; RR_CatalogosNegocio CN = new RR_CatalogosNegocio(); CN.ACCatalogoGradoEstudios(Datos); if (Datos.Completado) { Response.Redirect("frmGradoEstudiosGrid.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; } }
public void EliminarGeneroXID(RR_GradoEstudios Datos) { try { RR_CatalogoDatos CD = new RR_CatalogoDatos(); CD.EliminarGradoEstudioXID(Datos); } catch (Exception ex) { throw ex; } }
public void ObtenerDetalleXID(RR_GradoEstudios Datos) { try { RR_CatalogoDatos CD = new RR_CatalogoDatos(); CD.ObtenerDetalleXID(Datos); } catch (Exception ex) { throw ex; } }
public List <RR_GradoEstudios> ObtenerCatalogoGradoEstudios(RR_GradoEstudios Datos) { try { RR_CatalogoDatos CD = new RR_CatalogoDatos(); return(CD.ObtenerCatalogoGradoEstudio(Datos)); } catch (Exception ex) { throw ex; } }
public void ACCatalogoGradoEstudios(RR_GradoEstudios Datos) { try { RR_CatalogoDatos CD = new RR_CatalogoDatos(); CD.ACCatalogoGradoEstudios(Datos); } catch (Exception ex) { throw ex; } }
private void CargarDatos(RR_GradoEstudios DatosAux) { try { //BasicCrypto BC = new BasicCrypto(); //hf.Value = BC.Encripta(DatosAux.IDGenero.ToString()); hf.Value = DatosAux.IDGradoEstudios.ToString(); txtDescripcion.Value = DatosAux.Descripcion.ToString(); } catch (Exception ex) { throw ex; } }
public void CargarGrid() { try { RR_GradoEstudios Datos = new RR_GradoEstudios { Conexion = Comun.Conexion }; RR_CatalogosNegocio GN = new RR_CatalogosNegocio(); Lista = GN.ObtenerCatalogoGradoEstudios(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_GradoEstudios Datos = new RR_GradoEstudios { Conexion = Comun.Conexion, IDGradoEstudios = AuxID, IDUsuario = Comun.IDUsuario }; RR_CatalogosNegocio CN = new RR_CatalogosNegocio(); CN.EliminarGeneroXID(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); } }
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_GradoEstudios DatosAux = new RR_GradoEstudios() { Conexion = Comun.Conexion, IDGradoEstudios = ID }; RR_CatalogosNegocio CN = new RR_CatalogosNegocio(); CN.ObtenerDetalleXID(DatosAux); if (DatosAux.Completado) { this.CargarDatos(DatosAux); } else { //Ocurrió un error Response.Redirect("frmGradoEstudiosGrid.aspx?errorMessage=" + DatosAux.Resultado); } } else { Response.Redirect("frmGradoEstudiosGrid.aspx?errorMessage=1"); } } else { Response.Redirect("frmGradoEstudiosGrid.aspx?errorMessage=2"); } } else { Response.Redirect("frmGradoEstudiosGrid.aspx?errorMessage=3"); } } else { this.IniciarDatos(); } } else { //Page.Validate(); //if (IsValid) //{ if (Request.Form.Count == 6) { string txtDescripcion = Request.Form["ctl00$cph_MasterBody$txtDescripcion"].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); } catch (Exception ex) { Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message); } //} } } }