private void EditarProducto_Load(object sender, EventArgs e) { try { if (Login.userLevel == 1) { btnEliminarProducto.Enabled = true; } var result = productosNegocio.BuscarProductosPorID(BuscarProductos.productoID).FirstOrDefault(); indexCBCategoria = result.CategoriaID; indexCBProveedor = result.ProveedorID; txtProductoID.Text = BuscarProductos.productoID.ToString(); txtReferencia.Text = result.Referencia; txtDescripcion.Text = result.Descripcion; txtMarca.Text = result.Marca; txtCodigoBarra.Text = result.CodigoBarra; txtCalidad.Text = result.Calidad; txtExistencia.Text = result.Existencia.ToString(); txtPrecioCompra.Text = result.PrecioCompra.ToString(); txtPrecioVenta.Text = result.PrecioVenta.ToString(); txtDescuento.Text = result.Descuento.ToString(); txtCantMin.Text = result.CantMin.ToString(); txtCantMax.Text = result.CantMax.ToString(); CargarCBCategoria(); CargarCBProveedor(); CargarCBITBIS(); } catch (Exception exc) { MessageBox.Show("Error: " + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); loggeator.EscribeEnArchivo(exc.ToString()); } }
private void EditarProducto_Load(object sender, EventArgs e) { if (Login.userLevel == 1) { btnEliminarProducto.Enabled = true; } var result = productosNegocio.BuscarProductosPorID(BuscarProductos.productoID).FirstOrDefault(); indexCBCategoria = result.CategoriaID; indexCBProveedor = result.ProveedorID; txtProductoID.Text = BuscarProductos.productoID.ToString(); txtReferencia.Text = result.Referencia; txtDescripcion.Text = result.Descripcion; txtMarca.Text = result.Marca; txtCodigoBarra.Text = result.CodigoBarra; txtCalidad.Text = result.Calidad; txtExistencia.Text = result.Existencia.ToString(); txtPrecioCompra.Text = result.PrecioCompra.ToString(); txtPrecioVenta.Text = result.PrecioVenta.ToString(); txtDescuento.Text = result.Descuento.ToString(); txtCantMin.Text = result.CantMin.ToString(); txtCantMax.Text = result.CantMax.ToString(); CargarCBCategoria(); CargarCBProveedor(); CargarCBITBIS(); }