/// <summary>
 /// Abre un nuevo tema 
 /// </summary>
 /// <param name="pfecha">Fecha en que se abre el tema</param>
 /// <param name="pnombre">Nombre del nuevo tema</param>
 /// <param name="pdescripcion">Descripción del nuevo tema</param>
 /// <param name="pcantTemas">Cantidad de aportes</param>
 public static void abrirTema(DateTime pfecha, String pnombre, String pdescripcion, Boolean pestado, int pcantAportes, int pidForo)
 {
     //Por Camilo
     Clases.Tema tema = new Clases.Tema(pnombre, pdescripcion, pfecha, pcantAportes, pidForo);
     Persistentes.TemaPersistente temaPers = new Persistentes.TemaPersistente();
     temaPers.abrirTema(tema, pestado);
     //GestorRegistrar.registrarBitacora(" ha abierto el tema " + tema.titulo);
     //Registrar En Bitacora
     Estructuras.StructUsuario objActual;
     if (Clases.UsuarioTemporal._UsuarioActual != null)
     {
         objActual = Clases.UsuarioTemporal._UsuarioActual;
         GestorRegistrar.registrarBitacora("El usuario " + objActual.nombre + " ha abierto un tema al foro con con el código: " + pidForo, objActual);
     }
 }
        /// <summary>
        /// Nombre del metodo: agregarTemaAForo
        /// Funcionalidad: agregar Tema A un foro
        /// </summary>
        /// <param name="nombre">Nombre del estudiante</param>
        /// <param name="descripcion">Descripcion del tema</param>
        /// <param name="idForo">Id del foro</param>
        public static void agregarTemaAForo(string nombre, string descripcion, int idForo)
        {
            //Obtener la Fecha de hoy
            DateTime hoy = DateTime.Today;

            Clases.Tema tema = new Clases.Tema(nombre, descripcion, hoy, idForo, true);
            Persistentes.TemaPersistente temaPers = new Persistentes.TemaPersistente();
            temaPers.agregarTemaAForo(tema);

            //Registrar En Bitacora
            Estructuras.StructUsuario objActual;
            if (Clases.UsuarioTemporal._UsuarioActual != null)
            {
                objActual = Clases.UsuarioTemporal._UsuarioActual;
                GestorRegistrar.registrarBitacora("El usuario " + objActual.nombre + " ha creado un tema a un foro ", objActual);
            }
        }
Example #3
0
        /// <summary>
        /// Asigna estudiantes a un tema
        /// </summary>
        /// <param name="idEstudiante">ID del estudiante</param>
        /// <param name="pcodTema">Codigo del tema</param>
        public static void asignarEstudiantesATema(int idEstudiante, int pcodTema)
        {
            //djhvscf
               Persistentes.TemaPersistente temaPers = new Persistentes.TemaPersistente();
               temaPers.asignarEstudiantesATema(idEstudiante, pcodTema);
               //Estructuras.StructUsuario objActual;
               //objActual = Clases.UsuarioTemporal._UsuarioActual;
               //GestorRegistrar.registrarBitacora("El usuario " + objActual.nombre + " ha asignado al estudiante con el Id: " + idEstudiante + "al tema con el código: " + pcodTema, objActual);
               ////Capa de datos

               //Registrar En Bitacora
               Estructuras.StructUsuario objActual;
               if (Clases.UsuarioTemporal._UsuarioActual != null)
               {
               objActual = Clases.UsuarioTemporal._UsuarioActual;
               GestorRegistrar.registrarBitacora("El usuario " + objActual.nombre + " ha asignado al estudiante con el Id: " + idEstudiante + "al tema con el código: " + pcodTema, objActual);
               }
        }
Example #4
0
 /// <summary>
 /// Asigna estudiantes a un mea
 /// </summary>
 /// <param name="dtContenedorExcel">Lectura del excel</param>
 public static void asignarEstudiantesATemaAut(DataTable dtContenedorExcel)
 {
     //djhvscf
        try
        {
        Persistentes.TemaPersistente temaPers = new Persistentes.TemaPersistente();
        temaPers.asignarEstudiantesATemaAut(dtContenedorExcel);
        }
        catch (Exception ex)
        {
        throw new System.Exception(ex.Message);
        }
 }
Example #5
0
        /// <summary>
        /// Ver temas a los que un ususuario tiene accessso
        /// </summary>
        /// <param name="prol">nombre del rol del usuario</param>
        /// <param name="pidForo">identificacion del foro</param>
        /// <param name="pidUsuario">id de usuario</param>
        /// <returns>lista de temas</returns>
        public static List<Array> verTemasUsuario(String prol, int pidForo, int pidUsuario)
        {
            //Por Andrey Pérez

            try
            {
                dynamic _Usp = Capa_LogicaNegociosCENFOFORUM.Properties.Resources.usp_TemasXUsuario;

                List<Estructuras.StructTema> _temas = new List<Estructuras.StructTema>();
                Persistentes.TemaPersistente _temaPersist = new Persistentes.TemaPersistente();
                List<Array> _arreglo = new List<Array>();

                _temas = _temaPersist.obternerTemasXUsuario(_Usp, prol, pidForo, pidUsuario);

                foreach (Estructuras.StructTema _foro in _temas)
                {
                    String[] _datos =
                    {
                        _foro.Id.ToString(),
                        _foro.FechaCreacion.ToString(),
                        _foro.Titulo.ToString(),
                        _foro.Descripcion.ToString(),
                    };

                    _arreglo.Add(_datos);
                }
                return _arreglo;
            }
            catch (Exception ex)
            {
                throw new Exception("Error en la persistencia de temas.. " + ex.Message);
            }
        }
Example #6
0
        /// <summary>
        /// Obtiene solo el codigo de los temas
        /// </summary>
        /// <returns>Lista con los codigos de los temas</returns>
        public static List<int> obtenerCodigosTemas()
        {
            //Por djhvscf
              try
              {
              dynamic _Usp = Capa_LogicaNegociosCENFOFORUM.Properties.Resources.usp_ObtenerCodigosTemas;

              //declarar una variable tipo lista genérica de la clase ClsUsuario
              List<int> _temas = new List<int>();
              Persistentes.TemaPersistente _temaPersistente = new Persistentes.TemaPersistente();

              _temas = _temaPersistente.obtenerCodigoTemas(_Usp);

              return _temas;
              }
              catch (Exception ex)
              {
              throw new Exception("Error en la persistencia de Curso.. " + ex.Message);
              }
        }
Example #7
0
        /// <summary>
        /// Lista los temas de un foro
        /// </summary>
        /// <returns>Lista con todos los temas de un foro</returns>
        public static List<Array> listarTemasDeForo(int pidForo)
        {
            //Por Camilo Agüero
            try
            {
                dynamic _Usp = Capa_LogicaNegociosCENFOFORUM.Properties.Resources.usp_ListarTemasDeForo;

                List<Estructuras.StructTema> _temas = new List<Estructuras.StructTema>();
                Persistentes.TemaPersistente _temaPersistente = new Persistentes.TemaPersistente();
                List<Array> _arreglo = new List<Array>();

                _temas = _temaPersistente.buscarTemasDeForo(pidForo, _Usp);

                foreach (Estructuras.StructTema _tema in _temas)
                {

                    string[] _datos = {
                            _tema.Id.ToString(),
                            _tema.FechaCreacion.ToString(),
                            _tema.Titulo.ToString(),
                            _tema.Descripcion.ToString(),
                            _tema.estado.ToString(),
                            _tema.fk_TForo.ToString()
                         };

                    _arreglo.Add(_datos);
                }

                return _arreglo;
            }
            catch (Exception ex)
            {
                throw new Exception("Error en la persistencia de tema.. " + ex.Message);
            }
        }