Пример #1
0
        private void Btn_imprimir_Click(object sender, EventArgs e)
        {
            List <LibroAuxiliarDataSource> balance = new List <LibroAuxiliarDataSource>();
            string anio = this.negocioParametro.AnioTrabajo();
            int    mes  = this.negocioParametro.MesTrabajo();

            if (this.ValidarCampos())
            {
                if (this.tipoaux == 1)
                {
                    try
                    {
                        balance = this.negocioAsiento.CargarBalanceLibroAux(dt_fechaini.Value, dt_fechafin.Value, txt_cuentaini.Text, txt_cuentafin.Text, combo_ordenado.SelectedItem.ToString(), Program.compa, true);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("SE PRESENTO UN ERROR : " + ex.Message, "ERROR", MessageBoxButtons.OK);
                    }
                    Form_ReporteLibros frm = new Form_ReporteLibros(this, "anio", balance, dt_fechaini.Value, dt_fechafin.Value, check_centro.Checked, check_nit.Checked, check_totales.Checked);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                    this.DeshabilitarAnio();
                }
                else if (this.tipoaux == 2)
                {
                    List <LibroAuxiliarDataSource> movimientonit = new List <LibroAuxiliarDataSource>();
                    try
                    {
                        movimientonit = this.negocioAsiento.CargarBalanceLibroAuxNit(dt_fechaininit.Value, dt_fechafinnit.Value, txt_cuentaininit.Text, txt_cuentafinnit.Text, txt_nitininit.Text, txt_nitininit.Text, cbx_ordennit.SelectedItem.ToString(), Program.compa);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("SE PRESENTO UN ERROR : " + ex.Message, "ERROR", MessageBoxButtons.OK);
                    }
                    Form_ReporteLibros frm = new Form_ReporteLibros(this, "nit", movimientonit, dt_fechaini.Value, dt_fechafin.Value, check_centro.Checked, check_nit.Checked, check_totales.Checked);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                    this.DeshabilitarNit();
                }
                else if (this.tipoaux == 3)
                {
                    List <LibroAuxiliarDataSource> movimientosinact = new List <LibroAuxiliarDataSource>();
                    try
                    {
                        movimientosinact = this.negocioAsiento.CargarBalanceLibroAux(dt_fechainisinact.Value, dt_fechafinsinact.Value, txt_cueninisinact.Text, txt_cuefinsinact.Text, cbx_ordenadosinact.SelectedItem.ToString(), Program.compa, false);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("SE PRESENTO UN ERROR : " + ex.Message, "ERROR", MessageBoxButtons.OK);
                    }
                    Form_ReporteLibros frm = new Form_ReporteLibros(this, "sinact", movimientosinact, dt_fechaini.Value, dt_fechafin.Value, check_centro.Checked, check_nit.Checked, check_totales.Checked);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                    this.DeshabilitarSinActualizar();
                }
            }
        }
Пример #2
0
        private void Btn_imprimir_Click(object sender, EventArgs e)
        {
            string anio;
            int    mes;
            List <SaldosCuentasDataSource> balance = new List <SaldosCuentasDataSource>();

            try
            {
                anio = this.negocioParametro.AnioTrabajo();
                mes  = this.negocioParametro.MesTrabajo();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            if (this.ValidarCampos())
            {
                try
                {
                    if (check_grupos.Checked)
                    {
                        balance = this.negocioAsiento.CargarLibroMayorGrupo(int.Parse(cbx_mes.SelectedValue.ToString()), anio, Program.compa);
                    }
                    else
                    {
                        balance = this.negocioAsiento.CargarLibroMayor(int.Parse(cbx_mes.SelectedValue.ToString()), anio, Program.compa);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("SE PRESENTO UN ERROR : " + ex.Message, "ERROR", MessageBoxButtons.OK);
                }

                Form_ReporteLibros frm = new Form_ReporteLibros(this, "mayor", balance, dt_fecha.Value.ToShortDateString(), check_encab.Checked);
                frm.MdiParent = this.MdiParent;
                frm.Show();
                this.Deshabilitar();
            }
        }