예제 #1
0
        /// <summary>
        /// Trae el registro de Recinto como objeto Recinto
        /// </summary>
        /// <param name="id">id del recinto a Filtrar</param>
        /// <returns></returns>
        public RecintoBEL traerRecintoPorId(int id)
        {
            try
            {
                RECINTO recintoDalc = ConexionBLL.getConexion().RECINTO.FirstOrDefault(tmpRecinto => (tmpRecinto.ID_RECINTO.Equals(id)));

                if (recintoDalc != null)
                {
                    RecintoBEL recintoBEL = new RecintoBEL();
                    recintoBEL.IdRecinto        = (int)recintoDalc.ID_RECINTO;
                    recintoBEL.NombreRecinto    = recintoDalc.NOMBRE_RECINTO;
                    recintoBEL.DireccionRecinto = recintoDalc.DIRECCION_RECINTO;
                    recintoBEL.ImagenRecinto    = recintoDalc.IMAGEN_RECINTO;
                    recintoBEL.IdComuna         = (int)recintoDalc.ID_COMUNA;
                    recintoBEL.IdEstado         = (int)recintoDalc.ESTADO;

                    return(recintoBEL);
                }
                return(null);
            }
            catch
            {
                return(null);
            }
        }
예제 #2
0
 /// <summary>
 /// Elimina un registro de Recinto
 /// </summary>
 /// <param name="recinto">Objeto Recinto</param>
 public void eliminarRecinto(int idRecinto)
 {
     try
     {
         Entidades conexion    = ConexionBLL.getConexion();
         RECINTO   recintoDALC = (from tmpRec in conexion.RECINTO where tmpRec.ID_RECINTO == idRecinto select tmpRec).FirstOrDefault();
         recintoDALC.ID_RECINTO = idRecinto;
         conexion.DeleteObject(recintoDALC);
         conexion.SaveChanges();
     }
     catch
     {
         return;
     }
 }
예제 #3
0
        /// <summary>
        /// Modifica un registro de Recinto
        /// </summary>
        /// <param name="recinto">Objeto Recinto</param>
        public void editarRecinto(RecintoBEL recinto)
        {
            try
            {
                Entidades conexion    = ConexionBLL.getConexion();
                RECINTO   recintoDALC = (from tmpRec in conexion.RECINTO where tmpRec.ID_RECINTO == recinto.IdRecinto select tmpRec).FirstOrDefault();
                recintoDALC.ID_COMUNA         = recinto.IdComuna;
                recintoDALC.ID_RECINTO        = recinto.IdRecinto;
                recintoDALC.IMAGEN_RECINTO    = recinto.ImagenRecinto;
                recintoDALC.NOMBRE_RECINTO    = recinto.NombreRecinto;
                recintoDALC.DIRECCION_RECINTO = recinto.DireccionRecinto;
                recintoDALC.ESTADO            = recinto.IdEstado;

                conexion.SaveChanges();
            }
            catch
            {
                return;
            }
        }
예제 #4
0
        /// <summary>
        /// Agrega un nuevo registro de Recinto
        /// </summary>
        /// <param name="recinto">Objeto Recinto</param>
        public void agregarRecinto(RecintoBEL recinto)
        {
            try
            {
                Entidades conexion    = ConexionBLL.getConexion();
                RECINTO   recintoDALC = new RECINTO();
                recintoDALC.ID_COMUNA = recinto.IdComuna;
                //recintoDALC.ID_RECINTO = recinto.IdRecinto;
                recintoDALC.IMAGEN_RECINTO    = recinto.ImagenRecinto;
                recintoDALC.NOMBRE_RECINTO    = recinto.NombreRecinto;
                recintoDALC.DIRECCION_RECINTO = recinto.DireccionRecinto;

                conexion.AddToRECINTO(recintoDALC);
                conexion.SaveChanges();
                conexion.Dispose();
            }
            catch
            {
                return;
            }
        }
예제 #5
0
        /// <summary>
        /// Trae un evento como objeto Evento
        /// </summary>
        /// <param name="idEvento">id del evento a filtrar</param>
        /// <returns></returns>
        public EventoBEL traerEventoRecintoNombre(int idEvento)
        {
            try
            {
                Entidades conexion = ConexionBLL.getConexion();
                RECINTO   EvenDalc = (from tmpEvento in conexion.EVENTO
                                      join tmpRec in conexion.RECINTO on tmpEvento.ID_RECINTO equals tmpRec.ID_RECINTO
                                      where tmpEvento.ID_EVENTO == idEvento
                                      select tmpRec).FirstOrDefault();
                if (EvenDalc != null)
                {
                    EventoBEL evBEL = new EventoBEL();

                    evBEL.NombreRecinto = EvenDalc.NOMBRE_RECINTO;
                    return(evBEL);
                }

                return(null);
            }
            catch
            {
                return(null);
            }
        }