public ActionResult Create() { ArtistTask artistTask = new ArtistTask(); ViewBag.Progress = new SelectList(progress); return(View(artistTask)); }
private List <ArtistTask> GetConcertArtistTasks(Artist artist) { List <ArtistTask> concertTasks = new List <ArtistTask>(); List <Concert> upcomingConcerts = context.Concerts.Where(c => c.ArtistId == artist.ArtistId).ToList(); foreach (Concert concert in upcomingConcerts) { ArtistTask upcomingConcertTask1 = new ArtistTask() { Description = "Find 3 businesses that you can put a flyer up for the concert at " + concert.VenueName }; ArtistTask upcomingConcertTask2 = new ArtistTask() { Description = "Send a show reminder to the people on your mailing list for the concert at " + concert.VenueName }; ArtistTask upcomingConcertTask3 = new ArtistTask() { Description = "Find an activity that you can network at to tell people about the concert at " + concert.VenueName }; concertTasks.Add(upcomingConcertTask1); concertTasks.Add(upcomingConcertTask2); concertTasks.Add(upcomingConcertTask3); } return(concertTasks); }
// GET: ArtistTask/Edit/5 public ActionResult Edit(int id) { ArtistTask artistTask = context.ArtistTasks.FirstOrDefault(a => a.TaskId == id); ViewBag.Progress = new SelectList(progress); return(View(artistTask)); }
// GET: Artist/Details/5 public ActionResult Move(string description) { Artist artist = GetCurrentArtist(); ArtistTask task = new ArtistTask() { ArtistId = artist.ArtistId, Description = description, Progress = "Not Started" }; context.ArtistTasks.Add(task); context.SaveChanges(); return(RedirectToAction("Index", "ArtistTask")); }
public ActionResult Delete(int id, ArtistTask artistTask) { try { ArtistTask artistTaskFromDb = context.ArtistTasks.FirstOrDefault(a => a.TaskId == id); context.ArtistTasks.Remove(artistTaskFromDb); context.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Move(int id) { ArtistTask task = context.ArtistTasks.FirstOrDefault(a => a.TaskId == id); if (task.Progress == "Not Started") { task.Progress = "In Progress"; context.SaveChanges(); return(RedirectToAction("Index")); } else if (task.Progress == "In Progress") { task.Progress = "Completed"; context.SaveChanges(); return(RedirectToAction("Index")); } return(View()); }
public ActionResult Create(ArtistTask artistTask) { try { var progress = new SelectList(new[] { new { value = 1, text = "Not Started" }, new { value = 2, text = "In Progress" }, new { value = 3, text = "Completed" } }); ViewBag.Progress = progress; Artist currentArtist = GetCurrentArtist(); artistTask.ArtistId = currentArtist.ArtistId; context.ArtistTasks.Add(artistTask); context.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
private List <ArtistTask> GetMailingListArtistTask(Artist artist) { List <ArtistTask> mailingListTasks = new List <ArtistTask>(); List <MailingList> mailingList = context.MailingLists.Where(m => m.ArtistId == artist.ArtistId).ToList(); if (mailingList.Count < 25 || mailingList == null) { ArtistTask mailingTask1 = new ArtistTask() { Description = "Ask friends to sign up for your mailing list." }; mailingListTasks.Add(mailingTask1); ArtistTask mailingTask2 = new ArtistTask() { Description = "Find a solution to get fan emails before or after a show" }; mailingListTasks.Add(mailingTask2); ArtistTask mailingTask3 = new ArtistTask() { Description = "Make a list of artists that are similar to you, and find bloggers that will write about you. Find more information here: http://blog.sonicbids.com/5-strategies-to-get-your-music-featured-on-blogs" }; mailingListTasks.Add(mailingTask3); } else { ArtistTask mailingTask4 = new ArtistTask() { Description = "Send NewsLetter Out" }; mailingListTasks.Add(mailingTask4); ArtistTask mailingTask5 = new ArtistTask() { Description = "Send an email to get to know a random fan" }; mailingListTasks.Add(mailingTask5); } return(mailingListTasks); }
public ActionResult Edit(int id, ArtistTask artistTask) { try { var progress = new SelectList(new[] { new { value = 1, text = "Not Started" }, new { value = 2, text = "In Progress" }, new { value = 3, text = "Completed" } }); ViewBag.Progress = progress; var taskFromDb = context.ArtistTasks.FirstOrDefault(a => a.TaskId == id); taskFromDb.Description = artistTask.Description; taskFromDb.Progress = artistTask.Progress; context.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: ArtistTask/Delete/5 public ActionResult Delete(int id) { ArtistTask artistTask = context.ArtistTasks.FirstOrDefault(a => a.TaskId == id); return(View(artistTask)); }