public ActionResult Edit(int id) { IGigDAC dac = new GigDAC(); var gig = dac.Get(id); var model = new GigEdit { Date = gig.StartDateTime, Description = gig.Description, GigID = gig.GigID, Venue = gig.Venue }; return View(model); }
public ActionResult Edit(GigEdit gig) { if (!ModelState.IsValid) return View(gig); IGigDAC dac = new GigDAC(); dac.Update(gig.GigID, gig.Description, gig.Venue, gig.Date); return RedirectToAction("Index"); }
public ActionResult Create(GigCreate gig) { if (!ModelState.IsValid) return View(gig); IGigDAC dac = new GigDAC(); dac.Add(gig.Description, gig.Venue, gig.Date); return RedirectToAction("Index"); }
// GET: Admin/Gigs public ActionResult Index() { IGigDAC dac = new GigDAC(); int totalNoRecords; //upcoming gigs int startIndex = 0; IList<Gig> upcomingGigs = dac.Get("StartDateTime>=DATE()", "StartDateTime ASC", startIndex, Int32.MaxValue, out totalNoRecords); return View(upcomingGigs); }
public ActionResult Delete(int id) { IGigDAC dac = new GigDAC(); dac.Delete(id); return RedirectToAction("Index"); }