Esempio n. 1
0
        public List <ImagenesTenant> ObtenerImgTenant(int idTienda)
        {
            List <ImagenesTenant> img = new List <ImagenesTenant>();

            try
            {
                BackendDB back = new BackendDB();
                //var tienda = back.TiendaVirtual.FirstOrDefault(r => r.TiendaVitualId == idTienda);
                var imagenes = back.Imagenes.Where(t => t.TiendaId == idTienda);

                foreach (var imagen in imagenes)
                {
                    if (!imagen.ImagenEliminada)
                    {
                        ImagenesTenant aux = new ImagenesTenant();
                        aux.Nombre = imagen.Nombre;
                        aux.Uri    = imagen.UrlImagenMediana;
                        img.Add(aux);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(img);
        }
Esempio n. 2
0
        public int ObtenerIdTenant(String tenant)
        {
            int tiendaID;

            try
            {
                BackendDB back   = new BackendDB();
                var       tienda = back.TiendaVirtual.FirstOrDefault(r => r.Dominio == tenant);
                tiendaID = tienda.TiendaVitualId;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(tiendaID);
        }
Esempio n. 3
0
        public TiendaTenant ObtenerDatosTenant(int idTienda)
        {
            TiendaTenant tiendaInfo = new TiendaTenant();

            try
            {
                BackendDB back   = new BackendDB();
                var       tienda = back.TiendaVirtual.FirstOrDefault(r => r.TiendaVitualId == idTienda);
                tiendaInfo.Nombre      = tienda.Nombre;
                tiendaInfo.Css         = tienda.Css;
                tiendaInfo.Descripcion = tienda.Descripcion;
                tiendaInfo.Logo        = tienda.Logo;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(tiendaInfo);
        }
Esempio n. 4
0
        // Se busca si existe Sitio
        public Boolean ExisteSitio(String dominio)
        {
            bool retorno = false;

            try
            {
                BackendDB back   = new BackendDB();
                var       tienda = back.TiendaVirtual.FirstOrDefault(r => r.Dominio == dominio);
                if (tienda == null)
                {
                    retorno = false;
                }
                else
                {
                    retorno = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(retorno);
        }