protected void EliminarButton_Click(object sender, EventArgs e) { Analisis analisis = new Analisis(); RepositorioAnalisis repositorio = new RepositorioAnalisis(new Contexto()); if (repositorio.Eliminar(Convert.ToInt32(AnalisisId.Text))) { Utilitarios.Utils.ShowToastr(this, "Registro eliminado", "Exito", "success"); Limpiar(); } else { EliminarRequiredFieldValidator.IsValid = false; } }
protected void EliminarButton_Click(object sender, EventArgs e) { GridViewRow grid = DatosGridView.SelectedRow; RepositorioAnalisis repositorio = new RepositorioAnalisis(); if (IdTextBox.Text == 0.ToString()) { Utils.ShowToastr(this.Page, "Id no exite", "success"); return; } if (repositorio.Eliminar(Utils.ToInt(IdTextBox.Text))) { Utils.ShowToastr(this.Page, "Exito Eliminado", "success"); Limpiar(); } else { EliminarRequiredFieldValidator.IsValid = false; } }
protected void EliminarButton_Click(object sender, EventArgs e) { RepositorioAnalisis repositorio = new RepositorioAnalisis(); int id = AnalisisIdTextBox.Text.ToInt(); if (ExisteEnLaBaseDeDatos()) { MostrarMensajes.Visible = true; MostrarMensajes.Text = "Registro No encontrado"; MostrarMensajes.CssClass = "alert-danger"; return; } else { if (repositorio.Eliminar(id)) { Limpiar(); MostrarMensajes.Visible = true; MostrarMensajes.Text = "Eliminado Correctamente!!"; MostrarMensajes.CssClass = "alert-danger"; } } }
protected void eliminarButton_Click(object sender, EventArgs e) { RepositorioAnalisis repositorio = new RepositorioAnalisis(); int id = Utils.ToInt(IdTextBox.Text); var Analisis = repositorio.Buscar(id); if (Analisis != null) { if (repositorio.Eliminar(id)) { Utils.ShowToastr(this, "Eliminado", "Exito", "success"); Limpiar(); } else { Utils.ShowToastr(this, "No se pudo eliminar", "Error", "error"); } } else { Utils.ShowToastr(this, "No existe", "Error", "error"); } }