public ActionResult GetAlbumsForm(string q) { //uso mustage MusicStoreEntities db = new MusicStoreEntities(); var albums = db.Albums.Where(a => a.Title.Contains(q)).ToList().Take(5); return Json(albums, JsonRequestBehavior.AllowGet); }
public ActionResult ArtistSearchNEW(string q) { //uso mustage MusicStoreEntities db = new MusicStoreEntities(); var artists = db.Artists.Where(a => a.Name.Contains(q)).ToList(); return Json(artists, JsonRequestBehavior.AllowGet); }
public ActionResult ArtistSearch(string q) { //vista parcial MusicStoreEntities db = new MusicStoreEntities(); var artists = db.Artists.Where(a=>a.Name.Contains(q)).ToList(); return PartialView("ArtistSearch",artists); }
public ActionResult GetAlbumsScroll(string q, int Id) { //uso mustage MusicStoreEntities db = new MusicStoreEntities(); var albums = db.Albums.Where(a => a.Title.Contains(q) && a.Id>Id).ToList().Take(5); if (albums.Count()==0) return Json(null, JsonRequestBehavior.AllowGet); return Json(albums, JsonRequestBehavior.AllowGet); }
public JsonResult AlbumsList(string Id) { using (MusicStoreEntities db = new MusicStoreEntities()) { List<Album> Albums = (from a in db.Albums.Include("Artist") where a.Title.Contains(Id) orderby a.Id ascending select a).ToList(); return Json(Albums, JsonRequestBehavior.AllowGet); } }
public string About(Album album) { using (MusicStoreEntities db = new MusicStoreEntities()) { if(album!=null) return "Thank you " + album.Title + ". Record Saved."; else return "Please complete the form."; } }
public ActionResult About() { using (MusicStoreEntities db = new MusicStoreEntities()) { ViewBag.Albums = (from r in db.Albums.Include("Artist").Include("Genre") select r.Title).ToList(); ViewBag.Genre = (from r in db.Genres select r.Name).ToList(); ViewBag.Artist = (from r in db.Artists select r.Name).ToList(); return View(); } }
public ActionResult DailyDeal() { MusicStoreEntities db = new MusicStoreEntities(); var album = db.Albums.Include("Artist").OrderBy(a => a.Price).First(); return PartialView("_DailyDeal", album); }
public ActionResult Siguiente(int Inicio, int Fin) { using(MusicStoreEntities db = new MusicStoreEntities()) { List<Album> Albums = (from a in db.Albums orderby a.Id ascending select a).Take(Fin).ToList(); Albums.RemoveRange(0, Inicio - 1); return View(Albums); } }
public ActionResult QuickSearch(string term) { MusicStoreEntities db = new MusicStoreEntities(); var artists = db.Artists.Where(a => a.Name.Contains(term)).ToList().Select(a => new { value = a.Name }); return Json(artists, JsonRequestBehavior.AllowGet); }
public ActionResult Index() { ViewBag.Message = "Modifique esta plantilla para poner en marcha su aplicación ASP.NET MVC."; MusicStoreEntities db = new MusicStoreEntities(); ViewBag.Inicio = 50; ViewBag.Fin = 100; // Siguiente en la lista try { ViewBag.Albums = (from a in db.Albums orderby a.Id ascending select a).Take(50).ToList(); } catch (Exception ex) { log.Debug("Debug error logging", ex); log.Info("Info error logging", ex); log.Warn("Warn error logging", ex); log.Error("Error error logging", ex); log.Fatal("Fatal error logging", ex); } return View(); }