Пример #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (validaForm() == "true")
     {
         try
         {
             ProductosModel producto = new ProductosModel();
             producto.nombre      = textBoxNombre.Text;// ToUpper();
             producto.codigoInt   = textBoxCodInt.Text;
             producto.unmditem    = textBoxUnMdItem.Text;
             producto.precioNeto  = Convert.ToDecimal(textBoxPrecioNeto.Text);
             producto.precioventa = Convert.ToInt32(textBoxPrecioBruto.Text);
             producto.exento      = checkBoxExento.Checked.ToString();
             producto.save(producto);
             this.frmlistaproduc.textBoxBuscaXNo.Text = textBoxNombre.Text;//.ToUpper();
             this.frmlistaproduc.buttonBuscar.PerformClick();
             MessageBox.Show(" El Producto se Guardo con Exito", "Digital Terminal", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             this.Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error al Guardar: " + ex, "Digital Terminal", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         ProductosModel producto = new ProductosModel();
         producto.nombre      = textBoxNombre.Text;
         producto.codigoInt   = textBoxCodInt.Text;
         producto.precioNeto  = Convert.ToDecimal(textBoxPrecioNeto.Text);
         producto.precioventa = Convert.ToInt32(textBoxPrecioBruto.Text);
         producto.exento      = checkBoxExento.Checked.ToString();
         producto.save(producto);
         MessageBox.Show(" El Producto se Guardo con Exito");
         this.Refresh();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Guardar: " + ex);
     }
 }