Exemple #1
0
        public void UpdateSession(Session session)
        {
            var s = _dbContext.Sessions.Find(session.ID);

            s.Name        = session.Name;
            s.Description = session.Description;
            s.Level       = session.Level;
            s.Location    = session.Location;
            s.Status      = session.Status;
            s.Tag_ID      = session.TagID;
            _dbContext.SaveChanges();
        }
Exemple #2
0
        public static Session AsSession(this OCC.Data.Session s)
        {
            Session session = new Session()
            {
                ID = s.ID,
                Name = s.Name,
                Description = s.Description,
                Location = s.Location,
                Speaker = s.Speaker.FirstName + " " + s.Speaker.LastName,
                SpeakerID = s.Speaker.ID
                // starttime, endtime, level
            };

            return session;
        }
Exemple #3
0
        public void CreateSession(Session session)
        {
            Data.Session s = new Data.Session()
            {
                Event_ID = session.EventID,
                Speaker_ID = session.SpeakerID,
                Name = session.Name,
                Description = session.Description,
                Level = session.Level,
                Location = session.Location,
                Status = session.Status,
                Tag_ID = session.TagID.Value
            };

            _dbContext.Sessions.Add(s);
            _dbContext.SaveChanges();
        }
Exemple #4
0
        public void CreateSession(Session session)
        {
            Data.Session s = new Data.Session()
            {
                Event_ID    = session.EventID,
                Speaker_ID  = session.SpeakerID,
                Name        = session.Name,
                Description = session.Description,
                Level       = session.Level,
                Location    = session.Location,
                Status      = session.Status,
                Tag_ID      = session.TagID.Value
            };

            _dbContext.Sessions.Add(s);
            _dbContext.SaveChanges();
        }
Exemple #5
0
        public static Session Map(this Data.Session s)
        {
            Session session = new Session()
            {
                ID = s.ID,
                Name = s.Name,
                Description = s.Description,
                Level = s.Level,
                Status = s.Status,
                Location = s.Location,
                Speaker = s.Speaker.FirstName + " " + s.Speaker.LastName,
                ImageUrl = s.Speaker.ImageUrl,
                SpeakerID = s.Speaker.ID,
                TrackID = s.Track_ID,
                Track = s.Track == null ? "" : s.Track.Name,
                TimeslotID = s.Timeslot_ID,
                StartTime = s.Timeslot == null ? null : s.Timeslot.StartTime,
                EndTime = s.Timeslot == null ? null : s.Timeslot.EndTime,
                TagID = s.Tag_ID,
                EventID = s.Event_ID
            };

            return session;
        }
Exemple #6
0
        public void UpdateSession(Session session)
        {
            var s = _dbContext.Sessions.Find(session.ID);

            s.Name = session.Name;
            s.Description = session.Description;
            s.Level = session.Level;
            s.Location = session.Location;
            s.Status = session.Status;
            s.Tag_ID = session.TagID;
            _dbContext.SaveChanges();
        }