public bool GuardarTipoReserva(CatTipoReserva Obj)
        {
            try
            {
                BDVideosUSAVEntitiesModelSolicitudes Model = new BDVideosUSAVEntitiesModelSolicitudes();


                var querybusca = from c in Model.CatTipoBloques
                                 where c.Descripcion == Obj.DescTipoReserva
                                 select c;

                if (querybusca.ToList().Count == 0)
                {
                    Model.CatTipoReserva.Add(Obj);
                    Model.SaveChanges();
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }
 public Object ActualizaEdificios(CatEdificios obj)
 {
     try
     {
         BDVideosUSAVEntitiesModelSolicitudes Model = new BDVideosUSAVEntitiesModelSolicitudes();
         var querybusca = from c in Model.CatEdificios
                          where c.DescEdificios == obj.DescEdificios && c.IdEdificio != obj.IdEdificio
                          select c;
         if (querybusca.ToList().Count == 0)
         {
             var objeto = Model.CatEdificios.FirstOrDefault(c => c.IdEdificio == obj.IdEdificio);
             objeto.IdEdificio    = obj.IdEdificio;
             objeto.DescEdificios = obj.DescEdificios;
             objeto.Ubicacion     = obj.Ubicacion;
             objeto.Photo         = obj.Photo;
             Model.SaveChanges();
             return(true);
         }
         else
         {
             return("Descripcion repetida");
         }
     }
     catch (Exception ex)
     {
         return(ex);
     }
 }
        public bool ActualizaTipoBloques(CatTipoBloques Obj)
        {
            try
            {
                BDVideosUSAVEntitiesModelSolicitudes Model = new BDVideosUSAVEntitiesModelSolicitudes();
                var querybusca = from c in Model.CatTipoBloques
                                 where c.Descripcion == Obj.Descripcion && c.IdTipoBloque != Obj.IdTipoBloque
                                 select c;
                if (querybusca.ToList().Count == 0)
                {
                    var objeto = Model.CatTipoBloques.FirstOrDefault(c => c.IdTipoBloque == Obj.IdTipoBloque);
                    objeto.IdTipoBloque = Obj.IdTipoBloque;
                    objeto.Descripcion  = Obj.Descripcion;
                    objeto.DuracionM    = Obj.DuracionM;

                    Model.SaveChanges();
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public bool ActualizaTipoReserva(CatTipoReserva Obj)
        {
            try
            {
                BDVideosUSAVEntitiesModelSolicitudes Model = new BDVideosUSAVEntitiesModelSolicitudes();



                var querybusca = from c in Model.CatTipoReserva
                                 where c.DescTipoReserva == Obj.DescTipoReserva && c.IdTipoReserva != Obj.IdTipoReserva
                                 select c;
                if (querybusca.ToList().Count == 0)
                {
                    var objeto = Model.CatTipoReserva.FirstOrDefault(c => c.IdTipoReserva == Obj.IdTipoReserva);
                    objeto.IdTipoReserva   = Obj.IdTipoReserva;
                    objeto.DescTipoReserva = Obj.DescTipoReserva;
                    Model.SaveChanges();
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemple #5
0
        public List <ViewReservasLoc> VerReservacionesL()
        {
            using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
            {
                #region EjemploJoin
                //var query =
                //from R in context.TblReservas
                //join L in context.CatLocalidades
                //on R.id equals
                //    detail.Field<int>("SalesOrderID")
                //where order.Field<bool>("OnlineOrderFlag") == true
                //&& order.Field<DateTime>("OrderDate").Month == 8
                //select new
                //{
                //    SalesOrderID =
                //        order.Field<int>("SalesOrderID"),
                //    SalesOrderDetailID =
                //        detail.Field<int>("SalesOrderDetailID"),
                //    OrderDate =
                //        order.Field<DateTime>("OrderDate"),
                //    ProductID =
                //        detail.Field<int>("ProductID")
                //};
                #endregion

                var Query = (from C in context.ViewReservasLoc
                             select C).Take(30);
                return(Query.ToList());
            }
        }
Exemple #6
0
 public Object GuardarVideos(List <TblVideos> List)
 {
     try
     {
         BDVideosUSAVEntitiesModelSolicitudes Model = new BDVideosUSAVEntitiesModelSolicitudes();
         foreach (var item in List)
         {
             TblVideos Video = Model.TblVideos.FirstOrDefault(v => v.IdYoutube == item.IdYoutube);
             if (Video == null)
             {
                 Model.TblVideos.Add(item);
                 Model.SaveChanges();
             }
             else
             {
                 Video.NombreVideo = item.NombreVideo;
                 Video.Descripcion = item.Descripcion;
                 Video.Photo       = item.Photo;
                 //agregar numero de visitas;
                 Model.SaveChanges();
             }
         }
         return("Videos Guardados Correctamente");
     }
     catch (Exception ex)
     {
         return(ex);
     }
 }
Exemple #7
0
 public List <ViewReservasLoc> VerReservacionesXDocente(string Valor, DateTime f1, DateTime f2, int IdDocente)
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
     {
         bool?Confir = null;
         if (Valor != "null")
         {
             Confir = Convert.ToBoolean(Valor);
             var Query = (from C in context.ViewReservasLoc
                          where C.Confirmacion == Confir && C.IdCreadorVideo == IdDocente &&
                          (C.FechaSolicitud >= f1 && C.FechaSolicitud <= f2)
                          select C).Take(30);
             return(Query.ToList());
         }
         else
         {
             // var Query = context.TblReservas.Where(v => v.Confirmacion == null);
             var Query = (from C in context.ViewReservasLoc
                          where C.Confirmacion == null && C.IdCreadorVideo == IdDocente &&
                          (C.FechaSolicitud >= f1 && C.FechaSolicitud <= f2)
                          select C).Take(30);
             return(Query.ToList());
         }
     }
 }
        public async Task <IHttpActionResult> Register(RegisterBindingModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var user = new ApplicationUser()
            {
                UserName = model.Email,
                Email    = model.Email,
            };
            IdentityResult result = await UserManager.CreateAsync(user, model.Password);

            if (!result.Succeeded)
            {
                return(GetErrorResult(result));
            }
            BDVideosUSAVEntitiesModelSolicitudes Model = new BDVideosUSAVEntitiesModelSolicitudes();
            AspNetUsers User = Model.AspNetUsers.FirstOrDefault(v => v.Email == user.Email);

            User.Nombres   = model.Nombres;
            User.Apellidos = model.Apellidos;
            Model.SaveChanges();
            return(Ok());
        }
        public Object PostTakeServicios()
        {
            BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes();
            var Query = from L in context.TblArticulos
                        select new { L.IdArticulo, L.TituloArticulo, L.ContenidoArticulo };

            return(Query.ToList());
        }
Exemple #10
0
 public List <USP_DetalleS_Result> VerDetalleSolicitud(int ID)
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
     {
         var Query = context.USP_DetalleS(ID);
         return(Query.ToList());
     }
 }
Exemple #11
0
        public Object InicializarVideos()
        {
            BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes();
            var Query = from L in context.TblVideos
                        select new { L.Id, L.Descripcion, L.Photo, L.NombreVideo, L.IdYoutube, L.FechaSubida };

            return(Query.ToList());
        }
        public Object InicializarTiposBloques()
        {
            BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes();
            var Query = from L in context.CatTipoBloques
                        select new { L.IdTipoBloque, L.Descripcion, L.DuracionM };

            return(Query.ToList());
        }
 public List <CatTipoBloques> VerTipoBloques(int ID)
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())             {
         var Query = from C in context.CatTipoBloques
                     where C.IdTipoBloque == ID
                     select C;
         return(Query.ToList());
     }
 }
 public List <TblConfiguracionLaboral> InicializarConfiguracionLaboral()
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
     {
         var Query = from L in context.TblConfiguracionLaboral
                     select L;
         return(Query.ToList());
     }
 }
        public Object InicializarEdificios()
        {
            BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes();

            var Query = from L in context.CatEdificios
                        select new { L.IdEdificio, L.DescEdificios, L.Photo, L.Ubicacion };

            return(Query.ToList());
        }
Exemple #16
0
        public List <TblReservas> VerReservaciones()
        {
            BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes();

            var Query = (from C in context.TblReservas
                         select C).Take(30);

            return(Query.ToList());
        }
Exemple #17
0
 public List <ViewReservasLoc> VerReservacionesTodasXL(string Localidad)
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
     {
         var Query = (from C in context.ViewReservasLoc
                      where  C.DescLocalidades == Localidad
                      select C).Take(30);
         return(Query.ToList());
     }
 }
 public List <TblConfiguracionLaboral> VerConfiguracionLaboral(int ID)
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
     {
         var Query = from C in context.TblConfiguracionLaboral
                     where C.IdConfigLababoral == ID
                     select C;
         return(Query.ToList());
     }
 }
 public List <CatTipoReserva> VerTipoReserva(string nombre)
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
     {
         var Query = from C in context.CatTipoReserva
                     where C.DescTipoReserva.Contains(nombre)
                     select C;
         return(Query.ToList());
     }
 }
        public Object InicializarTipoR()
        {
            //DataTable dt = new DataTable();
            BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes();

            var Query = from L in context.CatTipoReserva
                        select new { L.IdTipoReserva, L.DescTipoReserva };

            return(Query.ToList());
        }
 public List <CatEdificios> VerEdificios(string nombre)
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
     {
         var Query = from C in context.CatEdificios
                     where C.DescEdificios.Contains(nombre)
                     select C;
         return(Query.ToList());
     }
 }
 public List <CatEdificios> VerEdificios(int ID)
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
     {
         var Query = from C in context.CatEdificios
                     where C.IdEdificio == ID
                     select C;
         return(Query.ToList());
     }
 }
Exemple #23
0
 public List <TblReservas> VerReservaciones(int ID)
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
     {
         var Query = from C in context.TblReservas
                     where C.IdReserva == ID
                     select C;
         return(Query.ToList());
     }
 }
Exemple #24
0
 public List <ViewReservasLoc> VerReservacionesXDocente(int ID)
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
     {
         var Query = from C in context.ViewReservasLoc
                     where  C.IdCreadorVideo == ID
                     select C;
         return(Query.ToList());
     }
 }
Exemple #25
0
 public List <ViewReservasLoc> VerReservacionesXfecha(DateTime f1, DateTime f2)
 {
     using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
     {
         var Query = from C in context.ViewReservasLoc
                     where  (C.FechaSolicitud >= f1 && C.FechaSolicitud <= f2)
                     select C;
         return(Query.ToList());
     }
 }
Exemple #26
0
        public Object InicializarCalendario(DateTime Date1, DateTime Date2, int Id)
        {
            BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes();
            var Query = from C in context.VistaLocalidadCalendario
                        where C.FechaCalendario >= Date1 && C.FechaCalendario <= Date2 && C.IdLocalidad == Id
                        select new { FechaCalendario_hidden = C.FechaCalendario,
                                     IdCalendario_hidden    = C.IdCalendario,
                                     Fecha = C.FechaCal,
                                     hora  = C.hora,
                                     Confirmacion_hidden = C.Confirmacion };

            return(Query.ToList());
        }
 public bool GuardarCreador(TblCreadorVideos Creador)
 {
     try
     {
         BDVideosUSAVEntitiesModelSolicitudes Model = new BDVideosUSAVEntitiesModelSolicitudes();
         Model.TblCreadorVideos.Add(Creador);
         Model.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemple #28
0
        public Object InicializarVideosPV()
        {
            BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes();
            var Query = from L in context.TblVideos
                        select new { Id_hidden   = L.Id,
                                     Desc_hidden = L.Descripcion,
                                     //Photo_hidden = L.Photo,
                                     L.NombreVideo,
                                     IdYoutube_hidden = L.IdYoutube,
                                     Fecha_hidden     = L.FechaSubida,
                                     L.Photo };

            return(Query.ToList());
        }
Exemple #29
0
 public Object GuardarLocalidad(CatLocalidades Obj)
 {
     try
     {
         BDVideosUSAVEntitiesModelSolicitudes Model = new BDVideosUSAVEntitiesModelSolicitudes();
         Model.CatLocalidades.Add(Obj);
         Model.SaveChanges();
         return("Guardado Correctamente");
     }
     catch (Exception ex)
     {
         return(ex);
     }
 }
Exemple #30
0
        public List <TblCalendario> InicializarCalendarioActividades(DateTime SystemDate, int Id)
        {
            DataTable dt = new DataTable();

            using (BDVideosUSAVEntitiesModelSolicitudes context = new BDVideosUSAVEntitiesModelSolicitudes())
            {
                DateTime Date1 = SystemDate.AddDays(-1 * ((int)SystemDate.DayOfWeek - 1));
                DateTime Date2 = SystemDate.AddDays((-1 * ((int)SystemDate.DayOfWeek - 1)) + 5);

                var Query = from C in context.TblCalendario
                            where C.FechaCalendario >= Date1 && C.FechaCalendario <= Date2 && C.IdLocalidad == Id
                            select C;
                return(Query.ToList());
            }
        }