Ejemplo n.º 1
0
        private void btn_Cerrar_Click(object sender, EventArgs e)
        {
            RegistrarAsientosVentas formAsient = new RegistrarAsientosVentas();

            formAsient.Show();
            this.Close();
        }
Ejemplo n.º 2
0
        private void btn_SaveData_Click(object sender, EventArgs e)
        {
            btn_SaveData.Enabled = false;
            bool insert, insertDet = false;

            objAsiento             = new Asiento();
            objAsiento.Correlativo = txt_Correlativo.Text;
            objAsiento.Debe        = objDocumentoCab.DocumentoCabTotal;
            objAsiento.Fecha       = txt_Fecha.Text;
            objAsiento.Haber       = objDocumentoCab.DocumentoCabTotal;
            objAsiento.MonedaCod   = objDocumentoCab.DocumentoCabTipoMoneda;



            objAsiento.TipoAsiento = txt_TipoAsiento.Text;

            insert = objAsientoDao.insertarAsientoCab(objAsiento);
            if (insert)
            {
            }
            else
            {
                MessageBox.Show("Hubo un error al Guardar");
                return;
            }
            for (int i = 0; i < objListaAsientoDetalle.Count; i++)
            {
                objListaAsientoDetalle[i].Correlativo = txt_Correlativo.Text;
                objListaAsientoDetalle[i].FechaDoc    = objDocumentoCab.DocumentoCabFecha.ToString("dd/MM/yyyy");
                insertDet = objAsientoDao.insertarAsientoDet(objListaAsientoDetalle[i]);
                if (insertDet)
                {
                    String serie, nro;
                    serie = objListaAsientoDetalle[i].Documento.Substring(0, 4);
                    nro   = objListaAsientoDetalle[i].Documento.Substring(5);
                    objAsientoDao.updateEstadoAsientoVenta(serie, nro);
                }
                else
                {
                    MessageBox.Show("Hubo un error al Guardar");
                    return;
                }
            }
            if (insertDet)
            {
                MessageBox.Show("Se creó el Asiento Contable");
            }
            btn_SaveData.Enabled = true;
            RegistrarAsientosVentas formAsient = new RegistrarAsientosVentas();

            formAsient.Show();
            this.Close();
        }
Ejemplo n.º 3
0
        public RegistrarAsientosVentas()
        {
            InitializeComponent();
            this.ControlBox    = false;
            this.Text          = "Asientos Contables";
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(50, 20);

            objDocumentoDao = new DocumentoDAO();
            objMonedaDao    = new MonedaDAO();
            objMonedaDao.tipoCambio();
            AsientoVentaForm = this;
            cargarcmb();
            gridParams();
            objListaDocumentoCab    = objDocumentoDao.listarDocCabAsientos("01", "01");
            grd_Facturas.DataSource = objListaDocumentoCab;
            grd_Facturas.Refresh();
            grd_Facturas.Click       += Grd_Facturas_Click;
            grd_Facturas.DoubleClick += Grd_Facturas_DoubleClick;
            cmb_UnidadNegocio.SelectedIndexChanged += Cmb_UnidadNegocio_SelectedIndexChanged;
        }
Ejemplo n.º 4
0
 private void GenerarAsientosVentasToolStripMenuItem_Click(object sender, EventArgs e)
 {
     generarAsientosVentasToolStripMenuItem.Enabled = false;
     RegistroVentas.RegistrarAsientosVentas Check = new RegistroVentas.RegistrarAsientosVentas();
     Check.Show();
 }