Ejemplo n.º 1
0
        public bool TraerElAuxiliarDelMayorSobreLaCuentaBACK(ReportesEN oRegistroEN, DatosDeConexionEN oDatos)
        {
            try
            {
                Cnn = new MySqlConnection(TraerCadenaDeConexion(oDatos));
                Cnn.Open();

                Comando             = new MySqlCommand();
                Comando.Connection  = Cnn;
                Comando.CommandType = CommandType.Text;

                this.Consultas = string.Format(@"
                Select Fecha, AgregarNumeroDelaTransaccionPorTipo( t.idTipoDeTransaccion,NumeroDeTransaccion) as 'Trans', c.idCuenta, Concepto, 
                (Select concat(c2.idCuenta, ' - ', c2.DescCuenta) from cuenta as c2 where c2.idCuenta = '{0}') as 'DescCuenta',td.Debe, td.Haber, 
                case when gc.Debitos = '+' then td.Debe - td.haber + c.SaldoCuenta else td.Haber - td.Debe + c.SaldoCuenta end as 'SaldoActual',                
                ifnull((Select ifnull( concat(tdb.ReferenciaBanco, ' - ', tdb.DescBanco) ,' ') as 'DescBanco' from tansacciondetalle_banco as tdb where tdb.idTransaccionDetalle = td.idTransaccionDetalle),'') as 'DescBanco',    
                @Fecha1 as 'FechaInicial', @Fecha2 as 'FechaFinal'
                from transacciondetalle as td
                inner join transacciones as t on t.idTransacciones = td.idTransacciones
                inner join cuenta as c on c.NoCuenta = td.NoCuenta
                inner join categoriadecuenta as cc on cc.idCategoriaDeCuenta = c.idCategoriaDeCuenta
                inner join grupodecuentas as gc on gc.idGrupoDeCuentas = cc.idGrupoDeCuentas
                where SoloFecha( t.Fecha ) between SoloFecha( @Fecha1 ) and SoloFecha( @Fecha2 ) {1} {2} ", oRegistroEN.idCuenta, oRegistroEN.Where, oRegistroEN.OrderBy);

                Comando.CommandText = this.Consultas;

                Comando.Parameters.Add(new MySqlParameter("@Fecha1", MySqlDbType.Date)).Value = oRegistroEN.FechaInicial;
                Comando.Parameters.Add(new MySqlParameter("@Fecha2", MySqlDbType.Date)).Value = oRegistroEN.FechaFinal;

                Adaptador = new MySqlDataAdapter();
                DT        = new DataTable();

                Adaptador.SelectCommand = Comando;
                Adaptador.Fill(DT);

                return(true);
            }
            catch (Exception ex)
            {
                this.Error = ex.Message;

                return(false);
            }
            finally
            {
                if (Cnn != null)
                {
                    if (Cnn.State == ConnectionState.Open)
                    {
                        Cnn.Close();
                    }
                }

                Cnn       = null;
                Comando   = null;
                Adaptador = null;
            }
        }
Ejemplo n.º 2
0
 public bool TraerElEstadoDeResultadoPorRangoDeFecha(ReportesEN oREgistroEN, DatosDeConexionEN oDatos)
 {
     if (oReportesAD.TraerElEstadoDeResultadoPorRangoDeFecha(oREgistroEN, oDatos))
     {
         Error = string.Empty;
         return(true);
     }
     else
     {
         Error = oReportesAD.Error;
         return(false);
     }
 }
Ejemplo n.º 3
0
 public bool CalcularBalanceGeneralParaELHistorico(ReportesEN oREgistroEN, DatosDeConexionEN oDatos)
 {
     if (oReportesAD.CalcularBalanceGeneralParaELHistorico(oREgistroEN, oDatos))
     {
         Error = string.Empty;
         return(true);
     }
     else
     {
         Error = oReportesAD.Error;
         return(false);
     }
 }
Ejemplo n.º 4
0
 public bool CalcularEstadoDeResultadoPorMesEnDolares(ReportesEN oREgistroEN, DatosDeConexionEN oDatos)
 {
     if (oReportesAD.CalcularEstadoDeResultadoPorMesEnDolares(oREgistroEN, oDatos))
     {
         Error = string.Empty;
         return(true);
     }
     else
     {
         Error = oReportesAD.Error;
         return(false);
     }
 }
Ejemplo n.º 5
0
 public bool TraerSaldoActualDelasCuentasFull(ReportesEN oREgistroEN, DatosDeConexionEN oDatos)
 {
     if (oReportesAD.TraerSaldoActualDelasCuentasFull(oREgistroEN, oDatos))
     {
         Error = string.Empty;
         return(true);
     }
     else
     {
         Error = oReportesAD.Error;
         return(false);
     }
 }
Ejemplo n.º 6
0
 public bool CalCularRecapitulacionesParaHistorico(ReportesEN oREgistroEN, DatosDeConexionEN oDatos)
 {
     if (oReportesAD.CalCularRecapitulacionesParaHistorico(oREgistroEN, oDatos))
     {
         Error = string.Empty;
         return(true);
     }
     else
     {
         Error = oReportesAD.Error;
         return(false);
     }
 }
Ejemplo n.º 7
0
 public bool CalCularBalanzaDeComprobacionParaElHistorico(ReportesEN oREgistroEN, DatosDeConexionEN oDatos)
 {
     if (oReportesAD.CalCularBalanzaDeComprobacionParaElHistorico(oREgistroEN, oDatos))
     {
         Error = string.Empty;
         return(true);
     }
     else
     {
         Error = oReportesAD.Error;
         return(false);
     }
 }
Ejemplo n.º 8
0
 public bool GenerarAuxiliarMayorDesdeElHistorico(ReportesEN oREgistroEN, DatosDeConexionEN oDatos)
 {
     if (oReportesAD.GenerarAuxiliarMayorDesdeElHistorico(oREgistroEN, oDatos))
     {
         Error = string.Empty;
         return(true);
     }
     else
     {
         Error = oReportesAD.Error;
         return(false);
     }
 }
Ejemplo n.º 9
0
 public bool TraerElAuxiliarDelMayorSobreLaCuenta(ReportesEN oREgistroEN, DatosDeConexionEN oDatos)
 {
     if (oReportesAD.TraerElAuxiliarDelMayorSobreLaCuenta(oREgistroEN, oDatos))
     {
         Error = string.Empty;
         return(true);
     }
     else
     {
         Error = oReportesAD.Error;
         return(false);
     }
 }
Ejemplo n.º 10
0
 public bool CuentasDeResultadoAlMesCorrienteUsandoHistorico(ReportesEN oREgistroEN, DatosDeConexionEN oDatos)
 {
     if (oReportesAD.CuentasDeResultadoAlMesCorrienteUsandoHistorico(oREgistroEN, oDatos))
     {
         Error = string.Empty;
         return(true);
     }
     else
     {
         Error = oReportesAD.Error;
         return(false);
     }
 }
Ejemplo n.º 11
0
        public bool TraerElEstadoDeResultadoPorRangoDeFecha(ReportesEN oRegistroEN, DatosDeConexionEN oDatos)
        {
            try
            {
                Cnn = new MySqlConnection(TraerCadenaDeConexion(oDatos));
                Cnn.Open();

                Comando             = new MySqlCommand();
                Comando.Connection  = Cnn;
                Comando.CommandType = CommandType.StoredProcedure;
                Comando.CommandText = "TraerElEstadoDeResultadoPorRangoDeFecha";

                Comando.Parameters.Add(new MySqlParameter("@SWhere", MySqlDbType.VarChar, oRegistroEN.Where.Trim().Length)).Value   = oRegistroEN.Where.Trim();
                Comando.Parameters.Add(new MySqlParameter("@SOrder", MySqlDbType.VarChar, oRegistroEN.OrderBy.Trim().Length)).Value = oRegistroEN.OrderBy.Trim();
                Comando.Parameters.Add(new MySqlParameter("@Fecha1", MySqlDbType.DateTime)).Value = oRegistroEN.FechaInicial;
                Comando.Parameters.Add(new MySqlParameter("@Fecha2", MySqlDbType.DateTime)).Value = oRegistroEN.FechaFinal;

                Adaptador = new MySqlDataAdapter();
                DT        = new DataTable();

                Adaptador.SelectCommand = Comando;
                Adaptador.Fill(DT);

                return(true);
            }
            catch (Exception ex)
            {
                this.Error = ex.Message;

                return(false);
            }
            finally
            {
                if (Cnn != null)
                {
                    if (Cnn.State == ConnectionState.Open)
                    {
                        Cnn.Close();
                    }
                }

                Cnn       = null;
                Comando   = null;
                Adaptador = null;
            }
        }
Ejemplo n.º 12
0
        public bool GenerarAuxiliarMayorDesdeElHistorico(ReportesEN oRegistroEN, DatosDeConexionEN oDatos)
        {
            try
            {
                Cnn = new MySqlConnection(TraerCadenaDeConexion(oDatos));
                Cnn.Open();

                Comando             = new MySqlCommand();
                Comando.Connection  = Cnn;
                Comando.CommandType = CommandType.StoredProcedure;
                Comando.CommandText = "GenerarAuxiliarMayorDesdeElHistorico";

                Comando.Parameters.Add(new MySqlParameter("@idCuenta_", MySqlDbType.VarChar, oRegistroEN.idCuenta.Trim().Length)).Value = oRegistroEN.idCuenta.Trim();
                Comando.Parameters.Add(new MySqlParameter("@Fecha1", MySqlDbType.DateTime)).Value = oRegistroEN.FechaInicial;
                Comando.Parameters.Add(new MySqlParameter("@Fecha2", MySqlDbType.DateTime)).Value = oRegistroEN.FechaFinal;

                Adaptador = new MySqlDataAdapter();
                DT        = new DataTable();

                Adaptador.SelectCommand = Comando;
                Adaptador.Fill(DT);

                return(true);
            }
            catch (Exception ex)
            {
                this.Error = ex.Message;

                return(false);
            }
            finally
            {
                if (Cnn != null)
                {
                    if (Cnn.State == ConnectionState.Open)
                    {
                        Cnn.Close();
                    }
                }

                Cnn       = null;
                Comando   = null;
                Adaptador = null;
            }
        }
Ejemplo n.º 13
0
        public bool CalcularBalanceGeneralPorMesEnDolares(ReportesEN oRegistroEN, DatosDeConexionEN oDatos)
        {
            try
            {
                Cnn = new MySqlConnection(TraerCadenaDeConexion(oDatos));
                Cnn.Open();

                Comando             = new MySqlCommand();
                Comando.Connection  = Cnn;
                Comando.CommandType = CommandType.StoredProcedure;
                Comando.CommandText = "CalcularBalanceGeneralPorMesEnDolares";

                Comando.Parameters.Add(new MySqlParameter("@FechaInicial", MySqlDbType.DateTime)).Value = oRegistroEN.FechaInicial;
                Comando.Parameters.Add(new MySqlParameter("@Fechafinal", MySqlDbType.DateTime)).Value   = oRegistroEN.FechaFinal;

                Adaptador = new MySqlDataAdapter();
                DT        = new DataTable();

                Adaptador.SelectCommand = Comando;
                Adaptador.Fill(DT);

                return(true);
            }
            catch (Exception ex)
            {
                this.Error = ex.Message;

                return(false);
            }
            finally
            {
                if (Cnn != null)
                {
                    if (Cnn.State == ConnectionState.Open)
                    {
                        Cnn.Close();
                    }
                }

                Cnn       = null;
                Comando   = null;
                Adaptador = null;
            }
        }
Ejemplo n.º 14
0
        public bool CalcularBalanceGeneralDeManeraDetalla(ReportesEN oRegistroEN, DatosDeConexionEN oDatos)
        {
            try
            {
                Cnn = new MySqlConnection(TraerCadenaDeConexion(oDatos));
                Cnn.Open();

                Comando             = new MySqlCommand();
                Comando.Connection  = Cnn;
                Comando.CommandType = CommandType.StoredProcedure;
                Comando.CommandText = "CalcularBalanceGeneral";

                Comando.Parameters.Add(new MySqlParameter("@SWhere", MySqlDbType.VarChar, oRegistroEN.Where.Trim().Length)).Value   = oRegistroEN.Where.Trim();
                Comando.Parameters.Add(new MySqlParameter("@SOrder", MySqlDbType.VarChar, oRegistroEN.OrderBy.Trim().Length)).Value = oRegistroEN.OrderBy.Trim();

                Adaptador = new MySqlDataAdapter();
                DT        = new DataTable();

                Adaptador.SelectCommand = Comando;
                Adaptador.Fill(DT);

                return(true);
            }
            catch (Exception ex)
            {
                this.Error = ex.Message;

                return(false);
            }
            finally
            {
                if (Cnn != null)
                {
                    if (Cnn.State == ConnectionState.Open)
                    {
                        Cnn.Close();
                    }
                }

                Cnn       = null;
                Comando   = null;
                Adaptador = null;
            }
        }