示例#1
0
 private void btnInsertar_Click(object sender, EventArgs e)
 {
     if (Validar() == true)
     {
         maquillaje.nombreDelProducto = txtNombre.Text;
         maquillaje.marca             = txtMarca.Text;
         maquillaje.tonoNumero        = txtTonoNum.Text;
         maquillaje.fechaDeExpiracion = txtFechaEx.Value;
         maquillaje.precioUnitario    = txtPrecio.Text;
         maquillaje.cantidad          = txtCantidad.Text;
         maquillaje.descripcion       = txtDescripcion.Text;
         maquillaje.proveedor         = Convert.ToInt32(txtidProveedor.Text);
         if (maquillaje.Guardar())
         {
             MessageBox.Show("Registro guardado correctamente", "Maquillaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show(string.Format("Error\n{0}", maquillaje.Error.ToString()), "Maquillaje", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("Se cancelo la edición");
     }
     limpiar();
 }