protected void Page_Load(object sender, EventArgs e) { try { List <Articulo> _lista = FachadaLogica.ListarArticulo(); _lista.Sort(); gvListado.DataSource = _lista; gvListado.DataBind(); } catch (Exception ex) { } }
protected void btnAgregar_Click(object sender, EventArgs e) { try { Articulo A = new Articulo(Convert.ToInt32(txtCodigo.Text), txtNombre.Text, Convert.ToDecimal(txtPrecio.Text)); FachadaLogica.AgregarArticulo(A); lblError.Text = "Articulo Ingresado Correctamente"; LimpiarTxt(); } catch (Exception ex) { lblError.Text = String.Format("Error al agregar el articulo {0}", ex.Message); } }