public ActionResult Create(int id) { var model = new CampRoomOption { CampId = id }; return(View("Create", model)); }
public async Task <ActionResult> Delete(CampRoomOption camp) { try { await _campRoomOptionService.DeleteAsync(camp); return(RedirectToAction("Index", "Camp")); } catch (Exception e) { return(View(camp)); } }
public async Task <ActionResult> Edit(CampRoomOption camp) { if (ModelState.IsValid) { try { await _campRoomOptionService.UpdateAsync(camp); return(RedirectToAction("Details", "Camp", new { id = camp.CampId })); } catch { return(RedirectToAction("Edit", new { id = camp.CampId })); } } else { return(View(camp)); } }