public ActionResult Create(string name, GameType game, DateTime datetime, int addressid) { if (ModelState.IsValid) { Event e = new Event() { Name = name, Game = game, DateTime = datetime, AddressId = addressid }; _gameservice.AddRecord(e); return RedirectToAction(Constant.Controller.Index, Constant.Controller.Home); } throw new EventException(Constant.EventExceptions.Message); }
public ActionResult Edit(int id, string name, GameType game, DateTime datetime, int addressid, string comments, string playersattending) { if (ModelState.IsValid) { Event e = new Event() { ID = id, Name = name, Game = game, DateTime = datetime, AddressId = addressid, Comments = comments, PlayersAttending = playersattending }; _gameservice.EditRecord(e); return RedirectToAction(Constant.Controller.Index, Constant.Controller.Home); } throw new EventException(Constant.EventExceptions.Message); }