public void AgregarNumeroSerie() { string s; if ((s = this.ValidarCamposNumeroSerie()) != null) { this.vista.MostrarMensaje(s, ETipoMensajeIU.ADVERTENCIA, null); return; } try { List <NumeroSerieBO> numerosSerie = this.vista.NumerosSerie; NumeroSerieBO numeroSerie = new NumeroSerieBO(); numeroSerie.Nombre = this.vista.Nombre; numeroSerie.NumeroSerie = this.vista.Serie; if (this.vista.NumerosSerie == null) { this.vista.NumerosSerie = new List <NumeroSerieBO>(); } numerosSerie.Add(numeroSerie); this.AgregarNumerosSerie(numerosSerie); this.vista.PrepararNuevoNumeroSerie(); } catch (Exception ex) { throw new Exception(this.nombreClase + ".AgregarNumeroSerie: " + ex.Message); } }
public bool PermitirQuitarNumeroSerie(NumeroSerieBO numeroSerie) { if (numeroSerie != null && numeroSerie.NumeroSerie == null) { return(true); } return(false); }
protected void grvNumeroSerie_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { NumeroSerieBO o = e.Row.DataItem != null ? (NumeroSerieBO)e.Row.DataItem : new NumeroSerieBO(); ((ImageButton)e.Row.FindControl("imgDelete")).Visible = o != null && !string.IsNullOrWhiteSpace(o.NumeroSerie); } } catch (Exception ex) { this.MostrarMensaje("Inconsistencia al desplegar el odómetro", ETipoMensajeIU.ERROR, this.nombreClase + ".grvNumeroSerie_RowDataBound:" + ex.Message); } }