Ejemplo n.º 1
0
        private Listing MapListingWithLocation(IDataReader reader, ref int idx)
        {
            Listing listing = new Listing();

            listing.Id                     = reader.GetSafeInt32(idx++);
            listing.ServiceType            = new LookUp();
            listing.ServiceType.Id         = reader.GetSafeInt32(idx++);
            listing.ServiceType.Name       = reader.GetSafeString(idx++);
            listing.ServiceProfileId       = reader.GetSafeInt32(idx++);
            listing.InternalName           = reader.GetSafeString(idx++);
            listing.Title                  = reader.GetSafeString(idx++);
            listing.ShortDescription       = reader.GetSafeString(idx++);
            listing.Description            = reader.GetSafeString(idx++);
            listing.IsActive               = reader.GetSafeBool(idx++);
            listing.CreatedBy              = _userDetailMapper.MapUserDetail(reader, ref idx);
            listing.DateCreated            = reader.GetSafeDateTime(idx++);
            listing.DateModified           = reader.GetSafeDateTime(idx++);
            listing.Event                  = new Event();
            listing.Event.Id               = reader.GetSafeInt32(idx++);
            listing.Event.Name             = reader.GetSafeString(idx++);
            listing.Event.Summary          = reader.GetSafeString(idx++);
            listing.Event.ShortDescription = reader.GetSafeString(idx++);
            listing.Event.ImageUrl         = reader.GetSafeString(idx++);
            listing.Event.DateStart        = reader.GetSafeDateTime(idx++);
            listing.Event.DateEnd          = reader.GetSafeDateTime(idx++);
            HostProfile hostProfile = new HostProfile();

            listing.ListingProfile = ConvertToExpando(hostProfile);
            listing.ListingProfile = reader.DeserializeObject <ExpandoObject>(idx++);
            listing.Location       = _mapLocation.MapLocation(reader, ref idx);

            listing.AdditionalServices = reader.GetSafeBool(idx++);

            if (listing.AdditionalServices.Equals(true))
            {
                listing.Services = reader.DeserializeObject <List <AdditionalService> >(idx++);
            }

            return(listing);
        }
Ejemplo n.º 2
0
        private Event MapEvent(IDataReader reader)
        {
            Event model = new Event();

            int index = 0;

            model.Id                 = reader.GetSafeInt32(index++);
            model.EventType          = new LookUp();
            model.EventType.Id       = reader.GetSafeInt32(index++);
            model.EventType.Name     = reader.GetSafeString(index++);
            model.EventCategory      = new LookUp();
            model.EventCategory.Id   = reader.GetSafeInt32(index++);
            model.EventCategory.Name = reader.GetSafeString(index++);
            model.Name               = reader.GetSafeString(index++);
            model.Summary            = reader.GetSafeString(index++);
            model.ShortDescription   = reader.GetSafeString(index++);
            model.Venue              = new Venue();
            model.Venue.Id           = reader.GetSafeInt32(index++);
            model.Venue.Name         = reader.GetSafeString(index++);
            model.Venue.Description  = reader.GetSafeString(index++);
            model.Venue.Url          = reader.GetSafeString(index++);
            model.Venue.IsDeleted    = reader.GetSafeBool(index++);
            model.Venue.ImageUrl     = reader.GetSafeString(index++);
            model.Venue.DateCreated  = reader.GetSafeDateTime(index++);
            model.Venue.DateModified = reader.GetSafeDateTime(index++);
            model.Venue.Location     = _mapLocation.MapLocation(reader, ref index);
            model.EventStatus        = new LookUp();
            model.EventStatus.Id     = reader.GetSafeInt32(index++);
            model.EventStatus.Name   = reader.GetSafeString(index++);
            model.ImageUrl           = reader.GetSafeString(index++);
            model.ExternalId         = reader.GetSafeInt32(index++);
            model.ExternalSiteUrl    = reader.GetSafeString(index++);
            model.IsFree             = reader.GetSafeBool(index++);
            model.DateStart          = reader.GetSafeDateTime(index++);
            model.DateEnd            = reader.GetSafeDateTime(index++);
            model.CreatedBy          = _userDetailMapper.MapUserDetail(reader, ref index);


            return(model);
        }
Ejemplo n.º 3
0
        private Therapist MapDetailedTherapist(IDataReader reader, out int startingIndex)
        {
            Therapist aTherapist = new Therapist();

            startingIndex = 0;

            aTherapist.Id        = reader.GetSafeInt32(startingIndex++);
            aTherapist.Email     = reader.GetSafeString(startingIndex++);
            aTherapist.FirstName = reader.GetSafeString(startingIndex++);
            aTherapist.Mi        = reader.GetSafeString(startingIndex++);
            aTherapist.LastName  = reader.GetSafeString(startingIndex++);
            aTherapist.AvatarUrl = reader.GetSafeString(startingIndex++);
            aTherapist.Phone     = reader.GetSafeString(startingIndex++);

            aTherapist.IsActive     = reader.GetSafeBool(startingIndex++);
            aTherapist.Notes        = reader.GetSafeString(startingIndex++);
            aTherapist.CreatedBy    = reader.GetSafeInt32(startingIndex++);
            aTherapist.DateCreated  = reader.GetDateTime(startingIndex++);
            aTherapist.DateModified = reader.GetDateTime(startingIndex++);

            aTherapist.Location = _locationMapper.MapLocation(reader, ref startingIndex);

            return(aTherapist);
        }