protected void EliminarButton_Click(object sender, EventArgs e) { Colores color = new Colores(); ObtenerValores(color); if (ColorIdTextBox.Text.Length == 0) { Validaciones.ShowToastr(this, "Advertencia", "Debe insertar un Id", "warning"); } else { if (color.Buscar(color.ColorId)) { if (color.Eliminar()) { Validaciones.ShowToastr(this, "Exito", "Eliminado correctamente!", "success"); Limpiar(); } else { Validaciones.ShowToastr(this, "Error", "Error al eliminar", "error"); } } else { Validaciones.ShowToastr(this, "Advertencia", "Id no encontrado", "warning"); Limpiar(); } } }
protected void EliminarBtn_Click(object sender, EventArgs e) { Colores color = new Colores(); Utilerias utileria = new Utilerias(); bool suiche = false; suiche = color.Buscar(utileria.ConvertirValor(BuscarIdTextBox.Text)); if (suiche) { if (color.Eliminar()) { Limpiar(); Utilerias2.ShowToastr(this, "", "Exito al eliminar!", "success"); } else { Utilerias2.ShowToastr(this, "Error", "Error al eliminar!", "error"); Limpiar(); } } else { Utilerias2.ShowToastr(this, "", "Este id no existe", "Warning"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Validar(); Colores color = new Colores(); if (Request.QueryString["ColorId"] != null) { if (color.Buscar(Validaciones.Entero(Request.QueryString["ColorId"].ToString()))) { DevolverValores(color); } } } }
protected void BuscarBtn_Click(object sender, EventArgs e) { Colores color = new Colores(); Utilerias utileria = new Utilerias(); color.ColorId = utileria.ConvertirValor(BuscarIdTextBox.Text); if (color.Buscar(color.ColorId)) { DescripcionTextBox.Text = color.Descripcion; } else { Utilerias2.ShowToastr(this, "", "Id no encontrado!", "Warning"); } }
protected void BuscarButton_Click(object sender, EventArgs e) { Colores color = new Colores(); ObtenerValores(color); if (ColorIdTextBox.Text.Length == 0) { Validaciones.ShowToastr(this, "Advertencia", "Debe insertar un Id", "warning"); } else { if (color.Buscar(color.ColorId)) { Limpiar(); DevolverValores(color); } else { Validaciones.ShowToastr(this, "Advertencia", "Id no encontrado", "warning"); Limpiar(); } } }
public void BuscarTest() { Colores color = new Colores(); Assert.IsTrue(color.Buscar(2)); }