예제 #1
0
 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);
 }
예제 #2
0
 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");
 }
예제 #3
0
        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");
        }
예제 #4
0
        // 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);
        }
예제 #5
0
 public ActionResult Delete(int id)
 {
     IGigDAC dac = new GigDAC();
     dac.Delete(id);
     return RedirectToAction("Index");
 }