Ejemplo n.º 1
0
        public static OutgoingMinimalVenue Parse(PoolReservation.Database.Entity.Venues x)
        {
            if (x == null)
            {
                return(null);
            }

            return(new OutgoingMinimalVenue
            {
                Id = x.Id,
                Name = x.Name,
                Type = OutgoingVenueType.Parse(x.VenueTypes),
                StartupMessageId = x.StartupMessage,
                IsHidden = x.IsHidden
            });
        }
Ejemplo n.º 2
0
        public static OutgoingVenue Parse(PoolReservation.Database.Entity.Venues x)
        {
            if (x == null)
            {
                return(null);
            }

            return(new OutgoingVenue
            {
                Id = x.Id,
                Name = x.Name,
                Type = OutgoingVenueType.Parse(x.VenueTypes),
                StartupMessage = OutgoingMiscellaneousHtml.Parse(x.MiscellaneousHtmlTable),
                IsHidden = x.IsHidden
            });
        }
Ejemplo n.º 3
0
        public HttpResponseMessage GetVenueTypes()
        {
            return(ErrorFactory.Handle(() =>
            {
                var userId = User?.Identity?.GetUserId();

                if (string.IsNullOrWhiteSpace(userId))
                {
                    throw new Exception();
                }


                using (var unitOfWork = new UnitOfWork())
                {
                    var venueTypes = unitOfWork.VenueTypes.GetVenueTypes(userId);

                    var outgoingVenueItemType = venueTypes.Select(x => OutgoingVenueType.Parse(x)).ToList();

                    return JsonFactory.CreateJsonMessage(outgoingVenueItemType, HttpStatusCode.OK, this.Request);
                }
            }, this.Request));
        }