Пример #1
0
		void ShowPopup(ReservationViewModel vm)
		{
			if (null == vm)
				return;

			var popup = new UIAlertView(View.Frame);

			popup.Title = vm.DocumentTitle;

			popup.AddButton("Kanseller reservasjon");
			popup.AddButton("Vis detaljer");
			popup.AddButton("Avbryt");

			popup.CancelButtonIndex = 2;

			popup.Dismissed += (sender, e) =>
			{
				switch(e.ButtonIndex)
				{
					case 0 : 
						ViewModel.RemoveReservation(vm);
						break;

					case 1: 
						ViewModel.ShowDetailsCommand.Execute(vm);
						break;
				}
			};

			popup.Show();
		}
Пример #2
0
 private void ExecuteCancelReservationCommand(ReservationViewModel reservation)
 {
     Parent.Load();
 }
Пример #3
0
        private void ExecuteRemoveReservationCommand(ReservationViewModel reservation)
        {
            Confirmed = ButtonText.Equals("Bekreft");

            if (Confirmed)
            {
                Parent.RemoveReservation(this);

                if (Parent.Reservations.Count == 0)
                {
                    Parent.AddReservation(new ReservationViewModel
                    {
                        DocumentTitle = "Du har ingen reservasjoner",
                        Status = "Du kan reservere gjennom mediedetaljsiden, enten gjennom søkeresultater, eller anbefalingslistene.",
                        ButtonVisible = false,
                        ListEmpty = true
                    });
                    ListEmpty = true;
                }
            }
            else
            {
                ButtonText = "Bekreft";

                DocumentTitle = "Vil du fjerne reservasjonen?";
                Status = "Da mister du din plass i køen for å låne denne!";

                CancellationButtonVisible = true;
                ReadyForPickup = false;
            }
        }
        public async void RemoveReservation(ReservationViewModel reservationViewModel)
        {
            Reservations.Remove(reservationViewModel);

            ReservationRemoved = true;

            await _service.RemoveReservation(reservationViewModel.DocumentNumber, reservationViewModel.Branch);
        }
		private void ExecuteShowDetailsCommand(ReservationViewModel model)
		{
			if (model.DocumentNumber != "")
			{
				ShowViewModel<MediaDetailViewModel>(new { title = model.DocumentTitle, docId = model.DocumentNumber });
			}
		}
 public void AddReservation(ReservationViewModel reservationViewModel)
 {
     Reservations.Add(reservationViewModel);
 }