public static bool EliminarDatos(string id) { DaoPrincipalGaleria daoPrincipalGaleria = new DaoPrincipalGaleria(); int idPrincipalGaleria = Convert.ToInt32(id); bool ok = daoPrincipalGaleria.Eliminar(idPrincipalGaleria); return ok; }
public static bool insertImagen(string url, string titulo) { DaoPrincipalGaleria daoPrincipalGaleria = new DaoPrincipalGaleria(); PojoPrincipalGaleria pojoPrincipalGaleria = new PojoPrincipalGaleria() { IdGaleria = daoPrincipalGaleria.obtenerID(titulo), Img = url }; bool ok = daoPrincipalGaleria.insertar(pojoPrincipalGaleria); return(ok); }
public static bool Actualizar(string titulo, string url, string descripcion) { DaoPrincipalGaleria daoPrincipalGaleria = new DaoPrincipalGaleria(); PojoPrincipalGaleria pojoPrincipalGaleria = new PojoPrincipalGaleria() { IdGaleria = Convert.ToInt32(titulo), Img = url }; bool ok = daoPrincipalGaleria.modificar(pojoPrincipalGaleria); return ok; }
public static List<PojoPrincipalGaleria> ListImg() { List<PojoPrincipalGaleria> lista = null; DaoPrincipalGaleria daoPrincipalGaleria = new DaoPrincipalGaleria(); try { lista = daoPrincipalGaleria.obtenerImagenes(); } catch (Exception ex) { lista = null; } return lista; }
public void mostrarImagenes() { if (!Page.IsPostBack) { ObjectCache cache = MemoryCache.Default; if (cache["CarouselInnerHtml"] != null) { //use the cached html ltImg.Text = cache["CarouselInnerHtml"].ToString(); } else { List<PojoPrincipalGaleria> lista = new List<PojoPrincipalGaleria>(); DaoPrincipalGaleria daoPrincipal = new DaoPrincipalGaleria(); var carouselInnerHtml = new StringBuilder(); lista = daoPrincipal.MostrarImagenes(); for (int i = 0; i < lista.Count(); i++) { if (i == 0) { carouselInnerHtml.AppendLine("<div class='carousel-item active'>"); carouselInnerHtml.AppendLine("<img src='" + lista[i].Img + "' alt='Third slide' />"); carouselInnerHtml.AppendLine("</div>"); } else { carouselInnerHtml.AppendLine("<div class='carousel-item'>"); carouselInnerHtml.AppendLine("<img src='" + lista[i].Img + "' alt='Second slide' />"); carouselInnerHtml.AppendLine("</div>"); } //ltParrafo.Text = "<div class='carousel-item active'> <img class='d-block w-100' src='"+ lista[1].Img + "' alt='Third Slide'/> </div>"; //ltParrafo.Text = "<div class='carousel-item'> <img class='d-block w-100' src='" + lista[i].Img + "' alt='Second Slide'/> </div>"; } cache["CarouselInnerHtml"] = ltImg.Text = carouselInnerHtml.ToString(); } } }
public static List <PojoPrincipal> cardarDatos() { DaoPrincipalGaleria daoPrincipalGaleria = new DaoPrincipalGaleria(); List <PojoPrincipal> ltPrincipal = new List <PojoPrincipal>(); try { ltPrincipal = daoPrincipalGaleria.obtenerIdPrincipal(); } catch (Exception ex) { ltPrincipal = null; } return(ltPrincipal); //for (int i = 0; i < ltPrincipal.Count(); i++) //{ // dpdlIdDescripcion.Items.Add(Convert.ToString(ltPrincipal[i].IdPrincipal)); //} }