private void button1_Click(object sender, EventArgs e)
        {
            string        resp     = "";
            ClassProducto producto = new ClassProducto();

            resp = producto.ActualizarProducto(Convert.ToInt32(textBox1.Text.ToString()), textBox2.Text.ToString(),
                                               textBox3.Text.ToString(), Convert.ToDouble(textBox4.Text.ToString()), Convert.ToInt32(textBox5.Text.ToString()),
                                               richTextBox1.Text.ToString(), dateTimePicker1.Value, checkBox1.Checked, Convert.ToInt16(label10.Text));
            MessageBox.Show(resp);
        }
Example #2
0
        private void ButtonActualizar_Click(object sender, RoutedEventArgs e)
        {
            if (TextProductoId.Text != "")
            {
                string        resp       = "Datos correctamente actualizados";
                ClassProducto Logica     = new ClassProducto();
                Producto      InfoEstado = new Producto();
                InfoEstado.productoID         = Convert.ToInt32(TextProductoId.Text);
                InfoEstado.nombreProducto     = TextNombreProduc.Text;
                InfoEstado.PrecioVenta        = Convert.ToSingle(TextPrecio.Text);
                InfoEstado.Descripcion        = TextDescripcion.Text;
                InfoEstado.descuentoProducto  = Convert.ToSingle(TextDescuento.Text);
                InfoEstado.existenciaProducto = Convert.ToInt32(TextExistencia.Text);
                InfoEstado.tipopID            = Convert.ToInt32(comboTipo.SelectedValue);
                InfoEstado.PresentacionID     = Convert.ToInt32(comboPresentacion.SelectedValue);
                InfoEstado.proveedorID        = Convert.ToInt32(comboProveedor.SelectedValue);
                resp = Logica.ActualizarProducto(InfoEstado);
                MessageBox.Show(resp);

                /*MessageBox.Show(TextCodigo.Text);
                 * MessageBox.Show(TextNombreEstado.Text);*/
                TextPresentacion.Clear();
                TextProductoId.Clear();
                TextNombreProduc.Clear();
                TextExistencia.Clear();
                TextDescripcion.Clear();
                TextDescuento.Clear();
                TextProveedor.Clear();
                TextPrecio.Clear();
                TextTipoProducto.Clear();
            }
            else
            {
                MessageBox.Show("Marque el registro a modificar", "Error al Editar",
                                MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
            }
            buttonGuardar.IsEnabled = true;
        }