public ActionResult EditRecurringEvent(EditRecurringEventModel ere) { List<EventLocation> locations = this._db.Query<EventLocation>("SELECT * FROM ec_locations").ToList(); locations.Insert(0, new EventLocation() { LocationName = "No Location", Id = 0 }); SelectList list = new SelectList(locations, "Id", "LocationName", ere.selectedLocation); ere.locations = list; if (!ModelState.IsValid) { TempData["StatusEditEvent"] = "Invalid"; return PartialView(ere); } TempData["StatusEditEvent"] = "Valid"; RecurringEvent re = new RecurringEvent() { Id = ere.id, title = ere.title, allDay = ere.allDay, calendarId = ere.calendar, locationId = ere.selectedLocation, description = ere.description, day = (int)ere.day, frequency = (int)ere.frequency, monthly_interval = (int)ere.monthly }; _db.Update(re, re.Id); return PartialView(ere); }
public ActionResult DeleteRecurringEvent(RecurringEvent e) { this._db.Delete<RecurringEvent>(e.Id); return RedirectToAction("ShowRecurringEvents", new { id = e.calendarId }); }