public ActionResult AddEvent(Events addevent) { //check if user is accessing view in web browser. if (ModelState.IsValid) { addevent.AddedBy = (int)Session["UserID"]; //Adds what we recieved from the view to the Create command EDA.AddEvent(Emap.Map(addevent)); } return(RedirectToAction("ViewEvent")); }
public int AddNewEvent(string eventName, string date, int organisationID) { Event newevent = new Event() { EventName = eventName, Date = date, OrganisationID = organisationID }; return(eventDataAccess.AddEvent(newevent)); }