Beispiel #1
0
 private void NuevoProductofrm_Load(object sender, EventArgs e)
 {
     Negocios.Negocio negocio = new Negocios.Negocio();
     negocio.ObtenerComboBoxes(boxMarca, "marcas");
     negocio.ObtenerComboBoxes(boxCategoria, "Categorias");
     negocio   = null;
     this.Text = "Keruministrador - Nuevo Producto";
     if (id != 0)
     {
         negocio = new Negocios.Negocio();
         Producto prod = new Producto();
         prod = negocio.ObtenerProducto(id);
         if (prod.imagen != "" && prod.imagen.Length > 5)
         {
             Image img = negocio.ObtenerImagen(prod.imagen);
             SetearImagen(img);
         }
         SetearDatos(prod);
         titulo.Text = "Modificar Producto";
         this.Text   = "Keruministrador - Modificar Producto";
     }
     txtCod.MaxLength            = 50;
     txtNombre.MaxLength         = 50;
     txtDesc.MaxLength           = 150;
     txtPrecioCentavos.MaxLength = 2;
     imageTxT.MaxLength          = 150;
     negocio = null;
 }
Beispiel #2
0
 private void Producto_Detalle_Load(object sender, EventArgs e)
 {
     try
     {
         Negocios.Negocio negocio = new Negocios.Negocio();
         negocio.ObtenerComboBoxes(boxMarca, "marcas");
         negocio.ObtenerComboBoxes(boxCategoria, "Categorias");
         Producto prod = new Producto();
         prod = negocio.ObtenerProducto(iid);
         if (prod.imagen != "" && prod.imagen.Length > 5)
         {
             Image img = negocio.ObtenerImagen(prod.imagen);
             SetearImagen(img);
         }
         SetearDatos(prod);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Keruministrador - Error!");
         this.Close();
     }
 }