예제 #1
0
        /// <summary>
        /// Copies from model.
        /// </summary>
        /// <param name="entity">The entity.</param>
        public override void SetFromEntity(IEntity entity)
        {
            base.SetFromEntity(entity);

            var campus = entity as Campus;

            if (campus == null)
            {
                return;
            }

            IsSystem            = campus.IsSystem;
            Name                = campus.Name;
            Description         = campus.Description;
            IsActive            = campus.IsActive;
            ShortCode           = campus.ShortCode;
            Url                 = campus.Url;
            LocationId          = campus.LocationId;
            TimeZoneId          = campus.TimeZoneId;
            PhoneNumber         = campus.PhoneNumber;
            LeaderPersonAliasId = campus.LeaderPersonAliasId;
            RawServiceTimes     = campus.ServiceTimes;

            Location = new CampusLocation(campus.Location);
        }
예제 #2
0
        /// <summary>
        /// Copies from model.
        /// </summary>
        /// <param name="entity">The entity.</param>
        public override void SetFromEntity(IEntity entity)
        {
            base.SetFromEntity(entity);

            var campus = entity as Campus;

            if (campus == null)
            {
                return;
            }

            IsSystem            = campus.IsSystem;
            Name                = campus.Name;
            Description         = campus.Description;
            IsActive            = campus.IsActive;
            ShortCode           = campus.ShortCode;
            Url                 = campus.Url;
            LocationId          = campus.LocationId;
            TimeZoneId          = campus.TimeZoneId;
            CampusStatusValueId = campus.CampusStatusValueId;
            CampusTypeValueId   = campus.CampusTypeValueId;
            TeamGroupId         = campus.TeamGroupId;
            PhoneNumber         = campus.PhoneNumber;
            LeaderPersonAliasId = campus.LeaderPersonAliasId;
            RawServiceTimes     = campus.ServiceTimes;
            CampusScheduleIds   = campus.CampusSchedules.Select(s => s.ScheduleId).ToList();
            Order               = campus.Order;

            Location = new CampusLocation(campus.Location);
        }
예제 #3
0
        /// <summary>
        /// Converts this instance of <see cref="CampusLocation"/> to an instance of <see cref="CampusLocationDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="CampusLocation"/> to convert.</param>
        public static CampusLocationDTO ToDTO(this CampusLocation entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new CampusLocationDTO();

            dto.CampusID         = entity.CampusID;
            dto.LocationID       = entity.LocationID;
            dto.CreatedByUserID  = entity.CreatedByUserID;
            dto.CreatedDate      = entity.CreatedDate;
            dto.ModifiedByUserID = entity.ModifiedByUserID;
            dto.ModifiedDate     = entity.ModifiedDate;
            entity.OnDTO(dto);

            return(dto);
        }
예제 #4
0
        /// <summary>
        /// Converts this instance of <see cref="CampusLocationDTO"/> to an instance of <see cref="CampusLocation"/>.
        /// </summary>
        /// <param name="dto"><see cref="CampusLocationDTO"/> to convert.</param>
        public static CampusLocation ToEntity(this CampusLocationDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new CampusLocation();

            entity.CampusID         = dto.CampusID;
            entity.LocationID       = dto.LocationID;
            entity.CreatedByUserID  = dto.CreatedByUserID;
            entity.CreatedDate      = dto.CreatedDate;
            entity.ModifiedByUserID = dto.ModifiedByUserID;
            entity.ModifiedDate     = dto.ModifiedDate;
            dto.OnEntity(entity);

            return(entity);
        }
예제 #5
0
 /// <summary>
 /// Invoked when <see cref="ToEntity"/> operation is about to return.
 /// </summary>
 /// <param name="entity"><see cref="CampusLocation"/> converted from <see cref="CampusLocationDTO"/>.</param>
 static partial void OnEntity(this CampusLocationDTO dto, CampusLocation entity);
예제 #6
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="CampusLocationDTO"/> converted from <see cref="CampusLocation"/>.</param>
 static partial void OnDTO(this CampusLocation entity, CampusLocationDTO dto);