Esempio n. 1
0
        public bool CreateEventDetail(Guid id, DateTime startDate, DateTime endDate, bool isAllDay)
        {
            var isSucess = false;

            try
            {
                var item = new EventDetailViewModel()
                {
                    StartDateTime = startDate,
                    EndDateTime   = endDate,
                    IsAllDay      = isAllDay
                };
                _events.Where(w => w.Id == id).First().Details.Add(item);
                //var eventItem = _events.Where(w => w.Id == id).First().Details.Add(item);
                //var indx = _events.IndexOf(eventItem);
                //_events[indx].Details.Add(item);
                isSucess = true;
            }
            catch (Exception e)
            {
                _logger.LogError(e.Message, e.StackTrace);
            }

            return(isSucess);
        }
Esempio n. 2
0
        public EventDetailPage(EventDetailViewModel selectedEvent, List <int> previousSeenTypes) : this()
        {
            eventDetails = selectedEvent;
            previouslySeenTypesOnEventPage = previousSeenTypes;

            //Check to see if user already has a track record.
            userType = Api.GetList(App.ApiUrl, new UserType()).Where(ut => ut.eventtypeid == eventDetails.eventDetail.eventtypeid &&
                                                                     ut.userid == App.CurrentUser.id).FirstOrDefault();

            var details = selectedEvent.eventDetail;

            lblName.Text        = details.name;
            lblType.Text        = details.TypeName;
            lblTime.Text        = details.eventstart.ToShortTimeString() + " - " + details.eventend.ToShortTimeString();
            lblLocation.Text    = details.locationname;
            lblDescription.Text = details.description;

            if (details.price == 0)
            {
                lblPrice.Text = "Free";
            }
            else if (details.price == 1)
            {
                lblPrice.Text = "$50+";
            }
            else
            {
                var price = details.price * 50;
                lblPrice.Text = "Around $" + Math.Round(price, 0);
            }
        }
Esempio n. 3
0
        public EventDetailPage(EventDetailViewModel viewModel)
        {
            InitializeComponent();

            BindingContext = this.viewModel = viewModel;
            //BindingContext = viewModel.Event;
        }
Esempio n. 4
0
        // GET: Event/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EventDTO EventDTO = EventService.GetEventID((int)id);

            if (EventDTO == null)
            {
                return(HttpNotFound());
            }
            UserViewModel        User = (UserViewModel)Session["User"];
            EventDetailViewModel EventDetailViewModel = EventMapping.EventDTO2EventDetailViewModel(EventDTO);

            Session["EventID"] = EventDetailViewModel.EventID;
            if (User != null)
            {
                EventDetailViewModel.CurrentUser = User.FullName;
            }
            else
            {
                EventDetailViewModel.CurrentUser = null;
            }

            return(View(EventDetailViewModel));
        }
Esempio n. 5
0
        public IActionResult EventDetail(string eventSlug)
        {
            if (eventSlug == null)
            {
                return(RedirectToAction("Error"));
            }

            var findEvent = _eventService.GetWeb(eventSlug);

            if (findEvent == null)
            {
                return(RedirectToAction("Error"));
            }

            var findCategoriesOfEvent = _eventService.GetEventCategories(findEvent.Id);

            EventDetailViewModel viewModel = new EventDetailViewModel
            {
                Slug          = findEvent.Slug,
                EditorContent = findEvent.EditorContent,
                Description   = findEvent.Description,
                ImageUrl      = findEvent.ImageUrl,
                Name          = findEvent.Name,
                Categories    = findCategoriesOfEvent,
                CampusId      = findEvent.Campus.Id,
                StartDate     = findEvent.StartDate,
                EndDate       = findEvent.EndDate,
                Location      = findEvent.Location,
            };

            return(View(viewModel));
        }
        public async Task <ActionResult> RegisterVisitor(EventDetailViewModel model)
        {
            ActionResult response = null;

            try
            {
                var currentUser = UserManager.FindByEmail(model.EventConfirmationViewModel.Email);
                if (currentUser == null) // This user name does not exists
                {
                    currentUser = new EventorUser()
                    {
                        UserName = model.EventConfirmationViewModel.Email, Email = model.EventConfirmationViewModel.Email
                    };
                    IdentityResult result = await UserManager.CreateAsync(currentUser);

                    if (result.Succeeded)
                    {
                        await UserManager.AddToRolesAsync(currentUser.Id, "Visitor");
                        await SignInAsync(currentUser, isPersistent : false);

                        response = Content("Success");
                    }
                }
            }
            catch (Exception ex)
            {
                response = Content(ex.Message);
            }
            return(response);
        }
        public ActionResult CreateEvent()
        {
            try
            {
                if (User.IsInRole(AppEnum.RoleEnum.User.ToString()))
                {
                    return(new HttpNotFoundResult());
                }
                var eventViewModel = new EventDetailViewModel();
                var eventType      = db.EventTypes.ToList();
                eventViewModel.EventTypeDropDownVm = new EventTypeDropDownViewModel()
                {
                    EventTypes = eventType
                };

                var eventVenue = db.EventVenues.ToList();
                eventViewModel.EventVenueDropDownVm = new EventVenueDropDownViewModel()
                {
                    EventVenues = eventVenue
                };
                return(View(eventViewModel));
            }
            catch (Exception)
            {
                return(View("Error"));
            }
        }
Esempio n. 8
0
        public EventDetail()
        {
            var vm = new EventDetailViewModel();

            BindingContext = vm;
            InitializeComponent();
        }
Esempio n. 9
0
        public EventDetailPage(Event selectedEvent)
        {
            InitializeComponent();

            EventDetailViewModel viewModel = new EventDetailViewModel(selectedEvent);

            BindingContext = viewModel;
        }
Esempio n. 10
0
        public void DisplayItineraries_ReturnsTrue_WhenEventIsItineraryManaged()
        {
            var sut = new EventDetailViewModel {
                EventType = AllReady.Models.EventType.Itinerary
            };

            Assert.True(sut.IsItineraryEvent);
        }
Esempio n. 11
0
        public void DisplayItineraries_ReturnsFalse_WhenEventIsNotItineraryManaged()
        {
            var sut = new EventDetailViewModel();

            sut.EventType = Models.EventType.Rally;

            Assert.False(sut.IsItineraryEvent);
        }
 private void EventDetailPage_BindingContextChanged(object sender, EventArgs e)
 {
     viewModel = BindingContext as EventDetailViewModel;
     if (viewModel != null)
     {
         viewModel.PropertyChanged += ViewModel_PropertyChanged;
     }
 }
Esempio n. 13
0
        public ViewModelLocator()
        {
            _navigationService = new NavigationService();
            _repository        = new ApiRepository();

            EventsViewModel       = new EventsViewModel(_navigationService, _repository);
            ParticipantsViewModel = new ParticipantsViewModel(_navigationService, _repository);
            EventDetailViewModel  = new EventDetailViewModel(_navigationService, _repository);
            NewEventViewModel     = new NewEventViewModel(_navigationService, _repository);
        }
        public EventDetailView(object parameter)
        {
            InitializeComponent();

            Parameter = parameter;

            BindingContext = new EventDetailViewModel();

            MyMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(37, -122), Distance.FromMiles(1)));
        }
Esempio n. 15
0
        public IActionResult Detail([FromServices] EventsContext eventsContext, string key)
        {
            var matchedEvent = eventsContext.Events.SingleOrDefault(e => e.EventKey == key);

            EventDetailViewModel viewModel = new EventDetailViewModel
            {
                Event = matchedEvent
            };

            return(View(viewModel));
        }
Esempio n. 16
0
        public IActionResult Detail(int id)
        {
            EventDetailViewModel eventDetail = new EventDetailViewModel()
            {
                Event      = _context.Events.Include(x => x.EventTeachers).ThenInclude(x => x.Teacher).Include(x => x.EventTags).ThenInclude(x => x.Tag).FirstOrDefault(x => x.Id == id),
                Tags       = _context.Tags.ToList(),
                Categories = _context.Categories.Include(x => x.Courses).ToList(),
            };

            return(View(eventDetail));
        }
Esempio n. 17
0
        public IActionResult Detail([FromServices] EventsContext eventsContext, string key)
        {
            var matchedEvent = default(Event);

            EventDetailViewModel viewModel = new EventDetailViewModel
            {
                Event = matchedEvent
            };

            return(View(viewModel));
        }
Esempio n. 18
0
        public void CompletedPercentage_ReturnsCorrectPercentage()
        {
            var sut = new EventDetailViewModel
            {
                TotalRequests     = 100,
                CompletedRequests = 20
            };

            var result = sut.CompletedPercentage;

            result.ShouldBe("20.0");
        }
        async void Handle_Tapped(object sender, System.EventArgs e)
        {
            if (sender == rollingBoard)
            {
                await Navigation.PushAsync(new EventListPage());

                var eventDetailPage      = new EventDetailPage();
                var eventDetailViewModel = new EventDetailViewModel((Meeting)rollingBoard.CurrentMessage);
                eventDetailPage.BindingContext = eventDetailViewModel;
                await Navigation.PushAsync(eventDetailPage);
            }
        }
Esempio n. 20
0
        public void CompletedPercentage_ReturnsZero_WhenTotalRequestsIsZero()
        {
            var sut = new EventDetailViewModel
            {
                TotalRequests     = 0,
                CompletedRequests = 0
            };

            var result = sut.CompletedPercentage;

            result.ShouldBe("0.0");
        }
Esempio n. 21
0
        public void AssignedPercentage_ReturnsCorrectPercentage()
        {
            var sut = new EventDetailViewModel
            {
                TotalRequests    = 100,
                AssignedRequests = 20
            };

            var result = sut.AssignedPercentage;

            result.ShouldBe(20D.ToString("0.0"));
        }
Esempio n. 22
0
        public void AssignedPercentage_ReturnsZero_WhenTotalRequestsIsZero()
        {
            var sut = new EventDetailViewModel
            {
                TotalRequests    = 0,
                AssignedRequests = 0
            };

            var result = sut.AssignedPercentage;

            result.ShouldBe(0D.ToString("0.0"));
        }
Esempio n. 23
0
        public void VolunteerFulfilmentPercentage_ReturnsZero_WhenVoluneersRequiredIsZero()
        {
            var sut = new EventDetailViewModel
            {
                VolunteersRequired = 0,
                AcceptedVolunteers = 0
            };

            var result = sut.VolunteerFulfilmentPercentage;

            result.ShouldBe(0D.ToString("0.0"));
        }
Esempio n. 24
0
        public void VolunteerFulfilmentPercentage_ReturnsCorrectPercentage()
        {
            var sut = new EventDetailViewModel
            {
                VolunteersRequired = 10,
                AcceptedVolunteers = 2
            };

            var result = sut.VolunteerFulfilmentPercentage;

            result.ShouldBe(20D.ToString("0.0"));
        }
Esempio n. 25
0
        public EventDetailPage()
        {
            InitializeComponent();

            var item = new Event
            {
                Name        = "Event 1",
                Description = "This is an event description."
            };

            viewModel      = new EventDetailViewModel(item);
            BindingContext = viewModel;
        }
        public async Task ReturnEventManagerInvitesWithStatusPending_WhenNotRejectedAcceptedOrRevoked()
        {
            var query = new EventDetailQuery {
                EventId = _queenAnneEventId
            };
            var handler = new EventDetailQueryHandler(Context);
            EventDetailViewModel result = await handler.Handle(query);

            result.EventManagerInvites.Count().ShouldBe(1);
            result.EventManagerInvites.Single().Id.ShouldBe(1);
            result.EventManagerInvites.Single().InviteeEmail.ShouldBe("*****@*****.**");
            result.EventManagerInvites.Single().Status.ShouldBe(EventDetailViewModel.EventManagerInviteStatus.Pending);
        }
Esempio n. 27
0
        // GET: Event/Details/5

        /**
         * Get an event detailed information by event id.
         */
        public ActionResult Details(int?id)
        {
            // Check id
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            // Retrieve event
            Event aEvent = db.Events.Find(id);

            // Check whether there exists such an event with given id.
            if (aEvent == null)
            {
                return(HttpNotFound());
            }
            aEvent.PosterImg = aEvent.PosterImg == "" ?
                               "/Content/img/placeholder.jpg" : "/Content/poster/" + aEvent.PosterImg;

            // Retrieve corresponding rates.
            JoinedViewModel  viewModel  = new JoinedViewModel();
            List <EventRate> eventRates = viewModel.EventRates.
                                          Where(r => r.Event_id == id).ToList();

            if (eventRates.Count == 0)
            {
                ViewBag.AvgScore = "No rates";
            }
            else
            {
                double avgScore = 0;
                foreach (var rate in eventRates)
                {
                    avgScore += rate.Rating_Score;
                }
                avgScore        /= eventRates.Count();
                ViewBag.AvgScore = String.Format("{0:0.0}", avgScore);
            }
            // Find ticketing information
            List <Ticket> tickets = db.Ticket.Where(r => r.Event_Id == id).ToList();

            // Constructing view model.
            EventDetailViewModel @event = new EventDetailViewModel(aEvent, eventRates, tickets);

            // Apply a new thread to handle visit logging task.
            new Thread(() => {
                EventVisitLogServices.LogVisit(@event.aEvent.EventId,
                                               Request.UserHostAddress.ToString(),
                                               User.Identity.GetUserId());
            }).Start();
            return(View(@event));
        }
Esempio n. 28
0
        public async Task <IActionResult> Detail(int id, string returnUrl)
        {
            var result = await _mediator.Send(new GetEventDetailQuery { Id = id });

            if (result == null)
            {
                return(NotFound());
            }
            EventDetailViewModel vm = new EventDetailViewModel(result);

            ViewData["Title"] = "Event Detail";
            ViewBag.ReturnUrl = returnUrl;
            return(View(vm));
        }
        public EventDetailPage(CalendarItem calendarItem)
        {
            _viewModel = new EventDetailViewModel();
            InitializeComponent();
            _viewModel.CurrentEventId = calendarItem.EventId;
            _viewModel.AllDay         = calendarItem.AllDay;
            _viewModel.AccessLevel    = calendarItem.AccessLevel;
            _viewModel.CurrentEvent   = calendarItem;
            _viewModel.EventTitle     = calendarItem.Title;
            _viewModel.Location       = calendarItem.Location;
            _viewModel.Notes          = calendarItem.Notes;

            BindingContext = _viewModel;
        }
Esempio n. 30
0
 public ActionResult ViewEvent()
 {
     try
     {
         var data = db.EventDetails.ToList();
         EventDetailViewModel eventDetailViewModel = new EventDetailViewModel();
         eventDetailViewModel.EventDetails = data;
         return(View(eventDetailViewModel));
     }
     catch
     {
         return(View("Error"));
     }
 }
 /// <summary>
 /// Provides a deterministic way to create the EventDetailViewModelPropertyName property.
 /// </summary>
 public static void CreateEventDetailViewModelPropertyName()
 {
     if (_eventDetailViewModel == null)
         _eventDetailViewModel = new EventDetailViewModel();
 }
 /// <summary>
 /// Provides a deterministic way to delete the EventDetailViewModelPropertyName property.
 /// </summary>
 public static void ClearEventDetailViewModelPropertyName()
 {
     _eventDetailViewModel.Cleanup();
     _eventDetailViewModel = null;
 }