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); }
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); }
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); }
// 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); }