예제 #1
0
        private void btnGenerar_Click(object sender, EventArgs e)
        {
            if (cmbPeriodo.Text.Equals(""))
            {
                MessageBox.Show("Error, escoja un periodo");
            }
            else
            {
                Periodo  periodoNuevo = new Periodo();
                string   nuevoEstado  = this.cmbPeriodo.SelectedItem.ToString();
                string[] tokens       = nuevoEstado.Split('/');
                string   fechaini     = tokens[0];

                string   nuevoEstadofin = this.comboBoxPeriodoFin.SelectedItem.ToString();
                string[] tokensfin      = nuevoEstadofin.Split('/');
                string   fechafin       = tokensfin[1];

                if (reporte.Equals("EstadoResultados"))
                {
                    dataset = LogicaEstadoResultados.obtenerEstadoResultados(Empresa, fechaini, fechafin);
                    dtgReporte.DataSource = dataset.Tables[0];
                    dtgReporte.Refresh();
                }
                else if (reporte.Equals("BalanceGeneral"))
                {
                    DataSet dataset = LogicaBalance.obtenerBalance(Empresa, fechaini, fechafin);
                    dtgReporte.DataSource = dataset.Tables[0];
                    dtgReporte.Refresh();
                }
            }
        }
예제 #2
0
        private void buttonVerEstadoResultados_Click(object sender, EventArgs e)
        {
            string fechaInicio;
            string fechaFin;

            fechaInicio = comboBoxPeriodoInicio.ToString();
            fechaFin    = comboBoxPeriodoFin.ToString();

            string stringFechaInicio = comboBoxPeriodoInicio.SelectedItem.ToString();

            string[] tokensInicio = stringFechaInicio.Split('/');
            fechaInicio = tokensInicio[0];

            string stringFechaFin = comboBoxPeriodoFin.SelectedItem.ToString();

            string[] tokensFin = stringFechaFin.Split('/');
            fechaFin = tokensFin[1];
            LogicaBalance.obtenerBalance(compania, fechaInicio, fechaFin);
        }