public ActionResult Create(SessionInputs inputs) { var session = new Session(inputs.StudyId) { ScheduledStart = inputs.ScheduledStart, Facilitator = inputs.Facilitator, RespondentName = inputs.RespondentName, RespondentOrganization = inputs.RespondentOrganization, RespondentUrl = inputs.RespondentUrl, VideoUrl = inputs.VideoUrl, Notes = inputs.Notes }; try { DocumentSession.Store(session); DocumentSession.SaveChanges(); return RedirectToAction("Details", "Studies", new { Id = inputs.StudyId }); } catch { ViewBag.Study = DocumentSession.Load<Study>(inputs.StudyId); return View(session); } }
/// <summary> /// Create a new Session object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="sessionToken">Initial value of the SessionToken property.</param> /// <param name="iPAddress">Initial value of the IPAddress property.</param> /// <param name="dateCreated">Initial value of the DateCreated property.</param> /// <param name="lastHeartbeat">Initial value of the LastHeartbeat property.</param> /// <param name="passKey">Initial value of the PassKey property.</param> /// <param name="status">Initial value of the Status property.</param> /// <param name="sMCSPort">Initial value of the SMCSPort property.</param> public static Session CreateSession(global::System.Int32 id, global::System.String sessionToken, global::System.String iPAddress, global::System.DateTime dateCreated, global::System.DateTime lastHeartbeat, global::System.String passKey, global::System.Byte status, global::System.Int32 sMCSPort) { Session session = new Session(); session.id = id; session.SessionToken = sessionToken; session.IPAddress = iPAddress; session.DateCreated = dateCreated; session.LastHeartbeat = lastHeartbeat; session.PassKey = passKey; session.Status = status; session.SMCSPort = sMCSPort; return session; }
/// <summary> /// Deprecated Method for adding a new object to the Sessions EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSessions(Session session) { base.AddObject("Sessions", session); }
// // GET: /Sessions/Create public ActionResult Create(string studyId) { ViewBag.Study = DocumentSession.Load<Study>(studyId); var session = new Session(studyId); return View(session); }