Example #1
0
        public Banco TraerBancos(Int16 id_Banco)
        {
            Database db = DatabaseFactory.CreateDatabase("ConveniosInt_V02");
            /* Definimos el nombre de la base que definimos en el Machine.config que luego se explicará. */
            DbCommand dbCommand = db.GetStoredProcCommand("TraeBancos");
            Banco     oParam;

            try
            {
                /* Se cargan los parámetros del store */
                db.AddInParameter(dbCommand, "@soloFrecuentes", DbType.Boolean, true);
                db.AddInParameter(dbCommand, "@id_Banco", DbType.Int16, id_Banco);

                /* Se ejecuta el store */
                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    ds.Read();
                    this.Fill(out oParam, ds);
                    ds.Close();
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en Banco.Datos " + System.Reflection.MethodBase.GetCurrentMethod(), ex);
            }
            //catch(sql)
            finally
            {
                db = null;
                dbCommand.Dispose();
            }

            return(oParam);
        }
Example #2
0
        public static Cierre TraerFechaCierreProx()
        {
            string    sql       = "Cierres_TProxFecCierre";
            Database  db        = DatabaseFactory.CreateDatabase("DAT_V01");
            DbCommand dbCommand = db.GetStoredProcCommand(sql);

            try
            {
                Cierre cierre = new Cierre();

                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (ds.Read())
                    {
                        cierre.FecCierre = ds["FecCierre"].ToString();
                        cierre.Mensual   = ds["Mensual"].ToString();
                    }

                    ds.Close();
                    ds.Dispose();
                }
                return(cierre);
            }
            catch (Exception ex)
            {
                log.Error(string.Format("{0}->{1}-> Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message));
                throw new Exception("Error en CierresDAO.TraerFechaCierreProx", ex);
            }
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
        }
Example #3
0
        public bool ImportData(string zoneId, string importDatabase)
        {
            bool          flag;
            Database      db      = DatabaseFactory.CreateDatabase();
            StringBuilder builder = new StringBuilder("");

            builder.Append(" SELECT ZoneID, ZoneName, ZoneJSName, ZoneIntro, ZoneType, DefaultSetting, ZoneSetting, ZoneWidth, ZoneHeight, ShowType, Active, UpdateTime FROM PE_AdZone ");
            OleDbConnection connection = new OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0;Data Source = " + importDatabase);

            try
            {
                connection.Open();
                builder.Append("Where ZoneID IN (" + zoneId + ") ORDER BY ZoneID");
                OleDbCommand       command = new OleDbCommand(builder.ToString(), connection);
                NullableDataReader reader  = new NullableDataReader(command.ExecuteReader(CommandBehavior.CloseConnection));
                while (reader.Read())
                {
                    ADZoneInfo adZoneInfo = new ADZoneInfo();
                    adZoneInfo.ZoneId         = GetMaxADZoneId();
                    adZoneInfo.ZoneName       = reader.GetString("ZoneName");
                    adZoneInfo.ZoneJSName     = reader.GetString("ZoneJSName");
                    adZoneInfo.ZoneIntro      = reader.GetString("ZoneIntro");
                    adZoneInfo.ZoneType       = (ADZoneType)reader.GetInt32("ZoneType");
                    adZoneInfo.DefaultSetting = reader.GetBoolean("DefaultSetting");
                    adZoneInfo.Setting        = reader.GetString("ZoneSetting");
                    adZoneInfo.ZoneWidth      = reader.GetInt32("ZoneWidth");
                    adZoneInfo.ZoneHeight     = reader.GetInt32("ZoneHeight");
                    adZoneInfo.ShowType       = reader.GetInt32("ShowType");
                    adZoneInfo.Active         = reader.GetBoolean("Active");
                    adZoneInfo.UpdateTime     = reader.GetDateTime("UpdateTime");
                    DbCommand command2 = GetProcdbComm(db, "PR_Ad_ADZone_ADD", adZoneInfo);
                    try
                    {
                        db.ExecuteNonQuery(command2);
                        continue;
                    }
                    catch
                    {
                        reader.Close();
                        return(false);
                    }
                }
                flag = true;
            }
            catch
            {
                flag = false;
            }
            finally
            {
                connection.Close();
            }
            return(flag);
        }
Example #4
0
        public static List <EstadoReclamo> Traer_Proximos(int idEstado)
        {
            string                sql          = "EstadoReclamo_Proximo";
            Database              db           = DatabaseFactory.CreateDatabase("DAT_V01");
            DbCommand             dbCommand    = db.GetStoredProcCommand(sql);
            DbParameterCollection dbParametros = null;

            db.AddInParameter(dbCommand, "@idEstado", DbType.Int32, idEstado);
            List <EstadoReclamo> ListEstado = new List <EstadoReclamo>();
            EstadoReclamo        oEst       = null;

            try
            {
                dbParametros = dbCommand.Parameters;

                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (ds.Read())
                    {
                        oEst            = new EstadoReclamo();
                        oEst.DescEstado = ds["DescEstado"].ToString();
                        oEst.IdEstado   = int.Parse(ds["IdEstado"].ToString());

                        oEst.Control          = ds.GetNullableString("Control");
                        oEst.ControlTexto     = ds.GetNullableString("ControlTexto");
                        oEst.ControlIdModelo  = ds.GetNullableInt32("ControlIdModelo") == null ? 0 : ds.GetInt32("ControlIdModelo");
                        oEst.EsFinal          = ds.GetNullableBoolean("EsFinal") == null ? false : ds.GetBoolean("EsFinal");
                        oEst.FecManual        = ds.GetNullableBoolean("FecManual") == null ? false : ds.GetBoolean("FecManual");
                        oEst.MensajeInfo      = ds.GetNullableString("MensajeInfo");
                        oEst.EstadoAnme       = ds.GetNullableInt32("EstadoAnme") == null ? 0 : ds.GetInt32("EstadoAnme");
                        oEst.PaseAutomatico   = ds.GetNullableBoolean("PaseAutomatico") == null ? false : ds.GetBoolean("PaseAutomatico");
                        oEst.TieneObservacion = ds.GetNullableBoolean("TieneObservacion") == null ? false : ds.GetBoolean("TieneObservacion");

                        ListEstado.Add(oEst);
                    }

                    ds.Close();
                    ds.Dispose();
                }
                return(ListEstado);
            }
            catch (Exception ex)
            {
                log.Error(string.Format("{0}->{1}->Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message));
                throw new Exception("Error en EstadoDAO.Trae_Todos", ex);
            }
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
        }
Example #5
0
        /* Esto se declara a nivel general*/
        //private DbParameterCollection dbParametros = null;
        //private string sql = string.Empty;


        #region TraeNotificacionesVencidas
        public List <NotificacionesVencidas> TraeDevolucionesNotificadasVencidasXPlazo(Int64 PageNum, Int64 PageSize, out Int64 TotalRowsNum, Byte ordenPor, Int16 DiasPlazo)
        {
            List <NotificacionesVencidas> result = null;
            Database db = DatabaseFactory.CreateDatabase("ConveniosInt_V02");
            /* Definimos el nombre de la base que definimos en el Machine.config que luego se explicará. */
            DbCommand dbCommand = db.GetStoredProcCommand("TraeDevolucionesNotificadasVencidasXPlazo");

            try
            {
                NotificacionesVencidas oParam;
                /* Se cargan los parámetros del store */
                db.AddInParameter(dbCommand, "@DiasPlazo", DbType.Int16, DiasPlazo);
                db.AddInParameter(dbCommand, "@PageNum", DbType.Int64, PageNum);
                db.AddInParameter(dbCommand, "@PageSize", DbType.Int64, PageSize);
                db.AddOutParameter(dbCommand, "@TotalRowsNum", DbType.Int64, int.MaxValue);
                db.AddInParameter(dbCommand, "@ordenPor", DbType.Byte, ordenPor);

                /* Se ejecuta el store */
                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    result = new List <NotificacionesVencidas>();
                    while (ds.Read())
                    {
                        /* Se llena el objeto con los datos del datareader */
                        this.Fill(out oParam, ds);
                        /* Se carga el objeto en la lista que se va a devolver */
                        result.Add(oParam);
                    }
                    ds.Close();
                    //}
                    /* Se recorre el datareader */
                }
                TotalRowsNum = (Int64)db.GetParameterValue(dbCommand, "@TotalRowsNum");
            }
            catch (Exception ex)
            {
                throw new Exception("Error en Consultas.Datos " + System.Reflection.MethodBase.GetCurrentMethod(), ex);
            }
            //catch(sql)
            finally
            {
                db = null;
                dbCommand.Dispose();
            }

            /* Se retorna la lista convirtiendola en Array */
            return(result);
        }
        public bool ImportData(string templateId, string importPath)
        {
            bool          flag;
            Database      db      = DatabaseFactory.CreateDatabase();
            StringBuilder builder = new StringBuilder("");

            builder.Append(" SELECT * FROM PE_ModelTemplates ");
            OleDbConnection connection = new OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0;Data Source = " + importPath);

            try
            {
                connection.Open();
                builder.Append("WHERE TemplateID IN (" + DBHelper.ToValidId(templateId) + ") ORDER BY templateId");
                OleDbCommand       command = new OleDbCommand(builder.ToString(), connection);
                NullableDataReader reader  = new NullableDataReader(command.ExecuteReader(CommandBehavior.CloseConnection));
                while (reader.Read())
                {
                    ModelTemplatesInfo modelTemplate = new ModelTemplatesInfo();
                    modelTemplate.TemplateId          = GetMaxId() + 1;
                    modelTemplate.TemplateName        = reader.GetString("TemplateName");
                    modelTemplate.TemplateDescription = reader.GetString("TemplateDescription");
                    modelTemplate.Field   = reader.GetString("Field");
                    modelTemplate.IsEshop = reader.GetBoolean("IsEshop") ? ModelType.Shop : ModelType.Content;
                    DbCommand command2 = GetProcdbComm(db, "PR_Contents_ModelTemplates_Add", modelTemplate);
                    try
                    {
                        db.ExecuteNonQuery(command2);
                        continue;
                    }
                    catch
                    {
                        reader.Close();
                        return(false);
                    }
                }
                flag = true;
            }
            catch
            {
                flag = false;
            }
            finally
            {
                connection.Close();
            }
            return(flag);
        }
Example #7
0
        public FaltanteDevolucion TraeFaltanteDevolucionXFechaMovimiento(Int64 id_Beneficiario, Int16 codPrestacion, string fechaMovimiento)
        {
            FaltanteDevolucion       oFaltanteD = null;
            List <TipoDocumentacion> result     = null;
            Database db = DatabaseFactory.CreateDatabase("ConveniosInt_V02");
            /* Definimos el nombre de la base que definimos en el Machine.config que luego se explicará. */
            DbCommand dbCommand = db.GetStoredProcCommand("TraeDevolucionesXFechaMovimiento");

            try
            {
                TipoDocumentacion oParam;
                /* Se cargan los parámetros del store */
                db.AddInParameter(dbCommand, "@id_Beneficiario", DbType.Int64, id_Beneficiario);
                db.AddInParameter(dbCommand, "@codPrestacion", DbType.Int16, codPrestacion);
                db.AddInParameter(dbCommand, "@fechaMovimiento", DbType.String, fechaMovimiento);

                /* Se ejecuta el store */
                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    oFaltanteD = new FaltanteDevolucion();
                    result     = new List <TipoDocumentacion>();
                    while (ds.Read())
                    {
                        /* Se llena el objeto con los datos del datareader */
                        Fill(out oParam, ds);
                        /* Se carga el objeto en la lista que se va a devolver */
                        result.Add(oParam);
                    }
                    ds.Close();
                    //}
                    /* Se recorre el datareader */
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en Envios.Datos " + System.Reflection.MethodBase.GetCurrentMethod(), ex);
            }
            //catch(sql)
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
            oFaltanteD.LTipoDocumentacionFaltante = result;
            /* Se retorna la lista convirtiendola en Array */
            return(oFaltanteD);
        }
Example #8
0
        public List <Documento_Causante> TraeDocumentosCausanteXid_Beneficiario(Int64 id_Beneficiario)
        {
            List <Documento_Causante> result = null;
            Database db = DatabaseFactory.CreateDatabase("ConveniosInt_V02");
            /* Definimos el nombre de la base que definimos en el Machine.config que luego se explicará. */
            DbCommand dbCommand = db.GetStoredProcCommand("TraeDocumentosCausanteXid_Beneficiario");

            try
            {
                Documento_Causante oParam;
                /* Se cargan los parámetros del store */
                db.AddInParameter(dbCommand, "@id_Beneficiario", DbType.Int64, id_Beneficiario);


                /* Se ejecuta el store */
                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    result = new List <Documento_Causante>();
                    while (ds.Read())
                    {
                        /* Se llena el objeto con los datos del datareader */
                        this.Fill(out oParam, ds);
                        /* Se carga el objeto en la lista que se va a devolver */
                        result.Add(oParam);
                    }
                    ds.Close();
                    //}
                    /* Se recorre el datareader */
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en Documentos.Datos " + System.Reflection.MethodBase.GetCurrentMethod(), ex);
            }
            //catch(sql)
            finally
            {
                db = null;
                dbCommand.Dispose();
            }

            /* Se retorna la lista convirtiendola en Array */
            return(result);
        }
Example #9
0
        public List <IndicadorPorSolicitudesPrestaciones> TraeIndicadorPorSolicitudesPrestaciones(Byte criteriotemporal, Byte param_Temporal, String anio)
        {
            List <IndicadorPorSolicitudesPrestaciones> result = null;
            Database db = DatabaseFactory.CreateDatabase("ConveniosInt_V02");
            /* Definimos el nombre de la base que definimos en el Machine.config que luego se explicará. */
            DbCommand dbCommand = db.GetStoredProcCommand("TraeIndicadorPorSolicitudesPrestaciones");

            try
            {
                IndicadorPorSolicitudesPrestaciones oParam;
                /* Se cargan los parámetros del store */
                db.AddInParameter(dbCommand, "@criteriotemporal", DbType.Byte, criteriotemporal);
                db.AddInParameter(dbCommand, "@param_Temporal", DbType.Byte, param_Temporal);
                db.AddInParameter(dbCommand, "@anio", DbType.String, anio);
                /* Se ejecuta el store */
                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    result = new List <IndicadorPorSolicitudesPrestaciones>();
                    while (ds.Read())
                    {
                        /* Se llena el objeto con los datos del datareader */
                        this.Fill(out oParam, ds);
                        /* Se carga el objeto en la lista que se va a devolver */
                        result.Add(oParam);
                    }
                    ds.Close();
                    //}
                    /* Se recorre el datareader */
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en Consultas.Datos " + System.Reflection.MethodBase.GetCurrentMethod(), ex);
            }
            //catch(sql)
            finally
            {
                db = null;
                dbCommand.Dispose();
            }

            /* Se retorna la lista convirtiendola en Array */
            return(result);
        }
Example #10
0
        public Movimiento_Solicitud TraeUltimoMovimientoSolicitud(Int64 idBeneficiario, Int16 codPrestacion)
        {
            Database db = DatabaseFactory.CreateDatabase("ConveniosInt_V02");
            /* Definimos el nombre de la base que definimos en el Machine.config que luego se explicará. */
            DbCommand            dbCommand = db.GetStoredProcCommand("TraeUltimoMovimientoSolicitud");
            Movimiento_Solicitud result    = null;

            try
            {
                /* Se cargan los parámetros del store */
                db.AddInParameter(dbCommand, "@id_Beneficiario", DbType.Int64, idBeneficiario);
                db.AddInParameter(dbCommand, "@cod_Prestacion", DbType.Int16, codPrestacion);
                db.AddOutParameter(dbCommand, "@codSector", DbType.Int32, 0);
                db.AddOutParameter(dbCommand, "@codEstado", DbType.Int32, 0);
                db.AddInParameter(dbCommand, "@modo", DbType.Byte, 1);
                /* Se ejecuta el store */


                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (ds.Read())
                    {
                        /* Se llena el objeto con los datos del datareader */
                        this.Fill(out result, ds);
                    }
                    ds.Close();
                    //}
                    /* Se recorre el datareader */
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en Consultas.Datos " + System.Reflection.MethodBase.GetCurrentMethod(), ex);
            }
            //catch(sql)
            finally
            {
                db = null;
                dbCommand.Dispose();
            }

            /* Se retorna la lista convirtiendola en Array */
            return(result);
        }
Example #11
0
        public static List <ModeloImpresion> ModeloImpresionTraer(int idEstado)
        {
            string                sql          = "EstadoReclamo_impresion";
            Database              db           = DatabaseFactory.CreateDatabase("DAT_V01");
            DbCommand             dbCommand    = db.GetStoredProcCommand(sql);
            DbParameterCollection dbParametros = null;

            db.AddInParameter(dbCommand, "@IdEstado", DbType.Int64, idEstado);
            List <ModeloImpresion> LstModeloImpresion = new List <ModeloImpresion>();
            ModeloImpresion        oModeloImpresion   = null;

            try
            {
                dbParametros = dbCommand.Parameters;

                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (ds.Read())
                    {
                        oModeloImpresion          = new ModeloImpresion();
                        oModeloImpresion.IdModelo = ds["idModeloImpresion"].ToString() == null?0:int.Parse(ds["idModeloImpresion"].ToString());
                        oModeloImpresion.Imprime  = ds["Imprime"].ToString() == null?false:bool.Parse(ds["Imprime"].ToString());
                        LstModeloImpresion.Add(oModeloImpresion);
                    }

                    ds.Close();
                    ds.Dispose();
                }
                return(LstModeloImpresion);
            }
            catch (Exception ex)
            {
                log.Error(string.Format("{0}->{1}->Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message));
                throw new Exception("Error en EstadoDAO.ModeloImpresionTraer", ex);
            }
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
        }
Example #12
0
        public static List <EstadoDocumentacion> Tipos_EstadosDocumentacion_Trae()
        {
            string                sql          = "TipoEstadoDocumentacion_Trae";
            Database              db           = DatabaseFactory.CreateDatabase("DAT_V01");
            DbCommand             dbCommand    = db.GetStoredProcCommand(sql);
            DbParameterCollection dbParametros = null;

            List <EstadoDocumentacion> ListEstado = new List <EstadoDocumentacion>();

            try
            {
                dbParametros = dbCommand.Parameters;

                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (ds.Read())
                    {
                        ListEstado.Add(new EstadoDocumentacion(int.Parse(ds["idEstadodocumentacion"].ToString()),
                                                               ds["descripcion"].ToString(), true,
                                                               Convert.ToBoolean(ds["verOnlineCarga"]),
                                                               Convert.ToBoolean(ds["debeIngresarCaja"]),
                                                               Convert.ToBoolean(ds["apruebaNovedad"])));
                    }

                    ds.Close();
                    ds.Dispose();
                }
                return(ListEstado);
            }
            catch (Exception ex)
            {
                log.Error(string.Format("{0}->{1}-> Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message));
                throw new Exception("Error en EstadoDAO.Tipos_EstadosDocumentacion_Trae", ex);
            }
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
        }
Example #13
0
        public static Estado Traer(int idEstado)
        {
            string                sql          = "EstadoReclamo_Trae_IdEstado";
            Database              db           = DatabaseFactory.CreateDatabase("DAT_V01");
            DbCommand             dbCommand    = db.GetStoredProcCommand(sql);
            DbParameterCollection dbParametros = null;

            db.AddInParameter(dbCommand, "@IdEstado", DbType.Int64, idEstado);
            Estado oEst = null;

            try
            {
                dbParametros = dbCommand.Parameters;

                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (ds.Read())
                    {
                        oEst            = new Estado();
                        oEst.DescEstado = ds["DescEstado"].ToString();
                        oEst.IdEstado   = int.Parse(ds["IdEstado"].ToString());
                    }

                    ds.Close();
                    ds.Dispose();
                }
                return(oEst);
            }
            catch (Exception ex)
            {
                log.Error(string.Format("{0}->{1}-> Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message));
                throw new Exception("Error en EstadoDAO.Traer", ex);
            }
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
        }
Example #14
0
        /* Esto se declara a nivel general*/
        //private DbParameterCollection dbParametros = null;
        //private string sql = string.Empty;

        #region Trae

        public Devolucion TraeDevolucionXMovimientoSolicitud(Int64 id_Beneficiario, Int16 codPrestacion, String fMovimiento)
        {
            Database db = DatabaseFactory.CreateDatabase("ConveniosInt_V02");
            /* Definimos el nombre de la base que definimos en el Machine.config que luego se explicará. */
            DbCommand  dbCommand = db.GetStoredProcCommand("TraeDevolucionesXMovimientoSolicitud");
            Devolucion oParam;

            try
            {
                /* Se cargan los parámetros del store */
                db.AddInParameter(dbCommand, "@id_Beneficiario", DbType.Int64, id_Beneficiario);
                db.AddInParameter(dbCommand, "@codPrestacion", DbType.Int16, codPrestacion);
                db.AddInParameter(dbCommand, "@fechaMovimiento", DbType.String, fMovimiento);


                /* Se ejecuta el store */
                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    ds.Read();
                    /* Se llena el objeto con los datos del datareader */
                    this.Fill(out oParam, ds);
                    /* Se carga el objeto en la lista que se va a devolver */
                    ds.Close();
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en Envios.Datos " + System.Reflection.MethodBase.GetCurrentMethod(), ex);
            }
            //catch(sql)
            finally
            {
                db = null;
                dbCommand.Dispose();
            }

            /* Se retorna la lista convirtiendola en Array */
            return(oParam);
        }
Example #15
0
        public static List <EstadoCaratulacion> Tipos_EstadosCaratulacion_Trae()
        {
            string                sql          = "EstadoNovCaratulacion_Traer";
            Database              db           = DatabaseFactory.CreateDatabase("DAT_V01");
            DbCommand             dbCommand    = db.GetStoredProcCommand(sql);
            DbParameterCollection dbParametros = null;

            List <EstadoCaratulacion> ListEstado = new List <EstadoCaratulacion>();

            try
            {
                dbParametros = dbCommand.Parameters;

                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (ds.Read())
                    {
                        ListEstado.Add(new EstadoCaratulacion(int.Parse(ds["IdEstado"].ToString()),
                                                              ds["DescEstadoNov"].ToString(), true,
                                                              short.Parse(ds["idEstadoExpediente"].ToString())));
                    }

                    ds.Close();
                    ds.Dispose();
                }
                return(ListEstado);
            }
            catch (Exception ex)
            {
                log.Error(string.Format("{0}->{1}-> Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message));
                throw new Exception("Error en EstadoDAO.Tipos_EstadosCaratulacion_Trae", ex);
            }
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
        }
Example #16
0
        public Pais TraerPaisXPaisPK(Int16 codPais)
        {
            Database db = DatabaseFactory.CreateDatabase("ConveniosInt_V02");
            /* Definimos el nombre de la base que definimos en el Machine.config que luego se explicará. */
            DbCommand dbCommand = db.GetStoredProcCommand("TraePaisXPaisPK");
            Pais      oParam    = null;

            try
            {
                /* Se cargan los parámetros del store */
                db.AddInParameter(dbCommand, "@codPais", DbType.Int16, codPais);

                /* Se ejecuta el store */
                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (ds.Read())
                    {
                        /* Se llena el objeto con los datos del datareader */
                        this.Fill(out oParam, ds);
                    }
                    ds.Close();
                    //}
                    /* Se recorre el datareader */
                }
                /* Se retorna la lista convirtiendola en Array */
                return(oParam);
            }
            catch (Exception ex)
            {
                throw new Exception("Error en Pais.Datos " + System.Reflection.MethodBase.GetCurrentMethod(), ex);
            }
            //catch(sql)
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
        }
Example #17
0
        public List <Cierre> TraerCierresAnteriores()
        {
            sql = "Cierres_TT";
            Database  db        = DatabaseFactory.CreateDatabase("DAT_V01");
            DbCommand dbCommand = db.GetStoredProcCommand(sql);

            try
            {
                List <Cierre> lstCierre = new List <Cierre>();

                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (ds.Read())
                    {
                        lstCierre.Add(new Cierre(
                                          ds.GetString("FecCierre"),
                                          ds.GetString("Mensual"),
                                          ds.GetNullableDateTime("FecAplicacionPagos")));
                    }

                    ds.Close();
                    ds.Dispose();
                }
                return(lstCierre);
            }
            catch (Exception ex)
            {
                log.Error(string.Format("{0}->{1}-> Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message));
                throw new Exception("Error en CierresDAO.TraerCierresAnteriores", ex);
            }
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
        }
Example #18
0
        public List <SolicitudesEFechasSolicitud> TraeSolicitudesEFechasSolicitud(String fechaDesde, String fechaHasta, Int16?codPrestacion, Int16?codPais, Boolean Mercosur, Byte orderBy)
        {
            List <SolicitudesEFechasSolicitud> result = null;
            Database db = DatabaseFactory.CreateDatabase("ConveniosInt_V02");
            /* Definimos el nombre de la base que definimos en el Machine.config que luego se explicará. */
            DbCommand dbCommand = db.GetStoredProcCommand("TraeSolicitudesEFechasSolicitud");

            try
            {
                SolicitudesEFechasSolicitud oParam;
                /* Se cargan los parámetros del store */
                db.AddInParameter(dbCommand, "@fechaAMSolD", DbType.String, fechaDesde);
                db.AddInParameter(dbCommand, "@fechaAMSolH", DbType.String, fechaHasta);
                if (codPrestacion.HasValue)
                {
                    db.AddInParameter(dbCommand, "@codPrestacion", DbType.Int16, codPrestacion.Value);
                }
                else
                {
                    db.AddInParameter(dbCommand, "@codPrestacion", DbType.Int16, null);
                }
                if (codPais.HasValue)
                {
                    db.AddInParameter(dbCommand, "@codPais", DbType.Int16, codPais.Value);
                }
                else
                {
                    db.AddInParameter(dbCommand, "@codPais", DbType.Int16, null);
                }
                db.AddInParameter(dbCommand, "@mercosur", DbType.Boolean, Mercosur);
                db.AddInParameter(dbCommand, "@orden", DbType.Byte, orderBy);
                /* Se ejecuta el store */
                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    result = new List <SolicitudesEFechasSolicitud>();
                    while (ds.Read())
                    {
                        /* Se llena el objeto con los datos del datareader */
                        this.Fill(out oParam, ds);
                        /* Se carga el objeto en la lista que se va a devolver */
                        result.Add(oParam);
                    }
                    ds.Close();
                    //}
                    /* Se recorre el datareader */
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en Consultas.Datos " + System.Reflection.MethodBase.GetCurrentMethod(), ex);
            }
            //catch(sql)
            finally
            {
                db = null;
                dbCommand.Dispose();
            }

            /* Se retorna la lista convirtiendola en Array */
            return(result);
        }
Example #19
0
        public static List <Reclamo> Reclamo_Traer(long idBeneficiario, long idPrestador, long idReclamo, int idEstado, DateTime FechaDesde, DateTime FechaHasta, string cuil)
        {
            List <Reclamo>        listaReclamos = new List <Reclamo>();
            string                sql           = "Reclamo_Trae_Filtro";
            Database              db            = DatabaseFactory.CreateDatabase("DAT_V01");
            DbCommand             dbCommand     = db.GetStoredProcCommand(sql);
            DbParameterCollection dbParametros  = null;
            Reclamo               unReclamo;

            try
            {
                if (idBeneficiario != 0)
                {
                    db.AddInParameter(dbCommand, "@IdBeneficiario", DbType.Int64, idBeneficiario);
                }
                else
                {
                    db.AddInParameter(dbCommand, "@IdBeneficiario", DbType.Int64, null);
                }

                if (idPrestador != 0)
                {
                    db.AddInParameter(dbCommand, "@IdPrestador", DbType.Int64, idPrestador);
                }
                else
                {
                    db.AddInParameter(dbCommand, "@IdPrestador", DbType.Int64, null);
                }

                if (idReclamo != 0)
                {
                    db.AddInParameter(dbCommand, "@IdReclamo", DbType.Int64, idReclamo);
                }
                else
                {
                    db.AddInParameter(dbCommand, "@IdReclamo", DbType.Int64, null);
                }

                if (idEstado != 0)
                {
                    db.AddInParameter(dbCommand, "@idEstado", DbType.Int32, idEstado);
                }
                else
                {
                    db.AddInParameter(dbCommand, "@idEstado", DbType.Int64, null);
                }

                if (FechaDesde != DateTime.MinValue)
                {
                    db.AddInParameter(dbCommand, "@FechaDesde", DbType.DateTime, FechaDesde);
                }
                else
                {
                    db.AddInParameter(dbCommand, "@FechaDesde", DbType.DateTime, null);
                }

                if (FechaHasta != DateTime.MinValue)
                {
                    db.AddInParameter(dbCommand, "@FechaHasta", DbType.DateTime, FechaHasta);
                }
                else
                {
                    db.AddInParameter(dbCommand, "@FechaHasta", DbType.DateTime, null);
                }
                if (!string.IsNullOrEmpty(cuil))
                {
                    db.AddInParameter(dbCommand, "@Cuil", DbType.String, cuil);
                }

                dbParametros = dbCommand.Parameters;
                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (ds.Read())
                    {
                        Fill(out unReclamo, ds);
                        listaReclamos.Add(unReclamo);
                    }
                    ds.Close();
                }

                return(listaReclamos);
            }

            catch (Exception ex)
            {
                log.Error(string.Format("{0}->{1}->Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message));
                throw new Exception("Error en ReclamoDAO.FiltroReclamo", ex);
            }
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
        }