public ActionResult Edit(Conference conference) { if (ModelState.IsValid) { db.Conferences.Attach(conference); db.ObjectStateManager.ChangeObjectState(conference, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(conference); }
public ActionResult Create(Conference conference) { if (ModelState.IsValid) { db.Conferences.AddObject(conference); db.SaveChanges(); return RedirectToAction("Index"); } return View(conference); }
/// <summary> /// Create a new Conference object. /// </summary> /// <param name="conferenceID">Initial value of the ConferenceID property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="date">Initial value of the Date property.</param> /// <param name="address">Initial value of the Address property.</param> /// <param name="country">Initial value of the Country property.</param> /// <param name="contactPhone">Initial value of the ContactPhone property.</param> /// <param name="organizer">Initial value of the Organizer property.</param> /// <param name="room">Initial value of the Room property.</param> /// <param name="duration">Initial value of the Duration property.</param> public static Conference CreateConference(global::System.Int32 conferenceID, global::System.String name, global::System.DateTime date, global::System.String address, global::System.String country, global::System.String contactPhone, global::System.String organizer, global::System.String room, global::System.TimeSpan duration) { Conference conference = new Conference(); conference.ConferenceID = conferenceID; conference.Name = name; conference.Date = date; conference.Address = address; conference.Country = country; conference.ContactPhone = contactPhone; conference.Organizer = organizer; conference.Room = room; conference.Duration = duration; return conference; }
/// <summary> /// Deprecated Method for adding a new object to the Conferences EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToConferences(Conference conference) { base.AddObject("Conferences", conference); }