コード例 #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();
        }
コード例 #2
0
ファイル: ModelExtensions.cs プロジェクト: slobo80/WebSite
        /// <summary>
        /// Maps a CodeCampService.Session to a Model.Session
        /// </summary>
        /// <param name="session"></param>
        /// <returns></returns>
        public static Model.Session Map(this Services.Session session)
        {
            var s = new Model.Session
            {
                ID          = session.ID,
                EventID     = session.EventID,
                Description = session.Description,
                Level       = session.Level.ToString(CultureInfo.InvariantCulture),
                Name        = session.Name,
                Speaker     = session.Speaker,
                SpeakerID   = session.SpeakerID,
                Status      = session.Status,
                Location    = string.IsNullOrEmpty(session.Location) ? string.Empty : session.Location
            };

            return(s);
        }
コード例 #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();
        }
コード例 #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();
        }
コード例 #5
0
ファイル: ModelExtensions.cs プロジェクト: slobo80/WebSite
        /// <summary>
        /// Maps a Model.Session to a CodeCampService.Session
        /// </summary>
        /// <param name="session"></param>
        /// <returns></returns>
        public static Services.Session Map(this Model.Session session)
        {
            int sessionLevel = 0;

            Int32.TryParse(session.Level, out sessionLevel);

            var s = new Services.Session
            {
                ID          = session.ID,
                EventID     = session.EventID,
                Description = session.Description,
                Level       = sessionLevel,
                Name        = session.Name,
                Speaker     = session.Speaker,
                SpeakerID   = session.SpeakerID,
                Status      = session.Status,
                Location    = string.IsNullOrEmpty(session.Location) ? string.Empty : session.Location
            };

            return(s);
        }
コード例 #6
0
        /// <summary>
        /// Maps a Model.Session to a CodeCampService.Session
        /// </summary>
        /// <param name="session"></param>
        /// <returns></returns>
        public static Services.Session Map(this Model.Session session)
        {
            int sessionLevel = 0;
            Int32.TryParse(session.Level, out sessionLevel);

            var s = new Services.Session
            {
                ID = session.ID,
                EventID = session.EventID,
                Description = session.Description,
                Level = sessionLevel,
                Name = session.Name,
                Speaker = session.Speaker,
                SpeakerID = session.SpeakerID,
                Status = session.Status,
                Location = string.IsNullOrEmpty(session.Location) ? string.Empty : session.Location
            };
            return s;
        }
コード例 #7
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();
        }
コード例 #8
0
 public void CreateSession(Session session)
 {
     _sessionRepository.CreateSession(session);
 }
コード例 #9
0
 public void UpdateSession(Session session)
 {
     _sessionRepository.UpdateSession(session);
 }
コード例 #10
0
ファイル: Mapper.cs プロジェクト: cfranciscodev/WebSite
        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;
        }