Esempio n. 1
0
        // Boton Guardar
        private void btn_Guardar_Click(object sender, EventArgs e)
        {
            // renglon = 0;
            try
            {
                string rpta = "";
                if (this.txtB_Proveedor.Text == string.Empty || this.txtB_NumFactura.Text == string.Empty ||
                    this.txtB_importetotal.Text == string.Empty)
                {
                    MensajeError("Falta ingresar alguno de los datos remarcados");

                    error_Icono.SetError(txtB_Proveedor, "Ingrese un Valor");
                    error_Icono.SetError(txtB_NumFactura, "Ingrese un Valor");
                    error_Icono.SetError(txtB_importetotal, "Ingrese un Valor");
                }
                else
                {
                    if (this.IsNuevo)
                    {
                        rpta = NNotaCompra.Insertar(this.txtB_NumFactura.Text.Trim().ToUpper(), dt_Fecha.Value, this.txtB_Proveedor.Text.Trim().ToUpper(), Convert.ToDecimal(this.txtB_importetotal.Text), dtDetalle);
                        NArticulo.Editar(codigo, descripcion, compra, venta, stockact);
                    }
                    if (rpta.Equals("OK"))
                    {
                        if (this.IsNuevo)
                        {
                            this.MensajeOk("Se Insertó de forma correcta");
                        }
                    }
                    else
                    {
                        this.MensajeError(rpta);
                    }
                    this.IsNuevo = false;
                    this.Botones();
                    this.Limpiar();
                    this.limpiarDetalle();
                    this.Mostrar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }