Esempio n. 1
0
        public List <NotificacionBE> ListarNotificacion(NotificacionBE entidad)
        {
            List <NotificacionBE> Lista = null;

            try
            {
                using (IDbConnection db = new OracleConnection(CadenaConexion))
                {
                    string sp = sPackage + "USP_SEL_USUARIO_NOTIFICACION";
                    var    p  = new OracleDynamicParameters();
                    p.Add("pID_ROL", entidad.ID_ROL);
                    p.Add("pIdUsuario", entidad.ID_USUARIO);
                    p.Add("pRegistros", entidad.cantidad_registros);
                    p.Add("pPagina", entidad.pagina);
                    p.Add("pSortColumn", entidad.order_by);
                    p.Add("pSortOrder", entidad.order_orden);
                    p.Add("pRefcursor", dbType: OracleDbType.RefCursor, direction: ParameterDirection.Output);
                    Lista = db.Query <NotificacionBE>(sp, p, commandType: CommandType.StoredProcedure).ToList();
                }

                //foreach (var item in Lista)
                //{
                //    item.FECHA = item.FECHA_REGISTRO.ToString("dd/MM/yyyy");
                //}
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }

            return(Lista);
        }
Esempio n. 2
0
        public NotificacionBE ConsultaNotificaciones(int Idusuario, int IdRol)
        {
            NotificacionBE entidad = new NotificacionBE();

            try
            {
                using (IDbConnection db = new OracleConnection(CadenaConexion))
                {
                    string sp = sPackage + "USP_SEL_NUM_NOFIFICACION";
                    var    p  = new OracleDynamicParameters();
                    p.Add("pIdRol", IdRol);
                    //p.Add("pIdUsuario", 0);
                    p.Add("pIdUsuario", Idusuario);
                    p.Add("pRefcursor", dbType: OracleDbType.RefCursor, direction: ParameterDirection.Output);
                    entidad = db.Query <NotificacionBE>(sp, p, commandType: CommandType.StoredProcedure).FirstOrDefault();
                }
                entidad.OK = true;
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                entidad.OK    = false;
                entidad.extra = ex.Message;
            }

            return(entidad);
        }
Esempio n. 3
0
        public NotificacionBE GetNotificacion(NotificacionBE entidad)
        {
            try
            {
                using (IDbConnection db = new OracleConnection(CadenaConexion))
                {
                    string sp = sPackage + "USP_GET_NOTIFICACION";
                    var    p  = new OracleDynamicParameters();
                    p.Add("pIdNotificacion", entidad.ID_NOTIFICACION);
                    p.Add("pRefcursor", dbType: OracleDbType.RefCursor, direction: ParameterDirection.Output);
                    entidad = db.Query <NotificacionBE>(sp, p, commandType: CommandType.StoredProcedure).FirstOrDefault();
                }
                entidad.OK = true;
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                entidad.OK = false;
            }

            return(entidad);
        }
Esempio n. 4
0
        public NotificacionBE RegistraVistoNotificacion(NotificacionBE entidad)
        {
            try
            {
                using (IDbConnection db = new OracleConnection(CadenaConexion))
                {
                    string sp = sPackage + "USP_UPD_VISTO_NOTIFICACION";
                    var    p  = new OracleDynamicParameters();
                    p.Add("pIdNotificacion", entidad.ID_NOTIFICACION);
                    p.Add("pIdIniciativa", entidad.ID_INICIATIVA);
                    p.Add("pIdUsuarioVisto", entidad.ID_USUARIO_VISTO);
                    db.Execute(sp, p, commandType: CommandType.StoredProcedure);
                }
                entidad.OK = true;
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }

            return(entidad);
        }
Esempio n. 5
0
 public static NotificacionBE RegistraVistoNotificacion(NotificacionBE entidad)
 {
     return(notificacionDA.RegistraVistoNotificacion(entidad));
 }
Esempio n. 6
0
 public static NotificacionBE GetNotificacion(NotificacionBE entidad)
 {
     return(notificacionDA.GetNotificacion(entidad));
 }
Esempio n. 7
0
 public static List <NotificacionBE> ListarNotificacion(NotificacionBE entidad)
 {
     return(notificacionDA.ListarNotificacion(entidad));
 }