Esempio n. 1
0
		public void Display ()
		{
			_reservation = ReservationRepository.GetRequestedReservation ();
			
			//CreateNotification (_reservation);
			if (_reservation != null) {
				/* 
				//Test
				_reservation.Status = StatusArt.ConfirmedByCustomer;
				ShowConfirmReservationView (_reservation);
				return;
				*/
				if (_reservation.ReservationTime < DateTime.Now) {
					_reservation.Status = StatusArt.AbortedByCustomer; // Abgelaufen
					ReservationRepository.Update (_reservation);
					ShowReservationView ();
					return;
				}
				CheckDeclinedByRestaurant ();
				
			} else {
				ShowReservationView ();
			}
			
		}
Esempio n. 2
0
		private void OnReservationAborteed (Reservation reservation)
		{
			
			if (this.ReservationAborted != null) {
				ReservationAborted (this, new EventArgs<Reservation> (reservation));
			}
		}
Esempio n. 3
0
		public static void Update (Reservation reservation)
		{
			reservation.ModifyAt = DateTime.Now;
			if (reservation.Id == 0) {
				reservation.CreateAt = DateTime.Now;
				db.Insert (reservation);
			} else {
				db.Update (reservation);
			}
		}
Esempio n. 4
0
		public CodeConfirmViewController (Reservation reservation) : this ()
		{
			_reservation = reservation;
		}
Esempio n. 5
0
		private void OnReserve (object sender, EventArgs e)
		{
			ResignResponder ();
			if (Validate ()) {
				_reservation = new Reservation ();
				_reservation.ReservationTime = _reservationDatePicker.Date.ToDateTime ();
				_reservation.GuestName = txtName.Text;
				_reservation.Mobile = txtPhone.Text;
				_reservation.Seats = int.Parse (txtSeats.Text);
				_reservation.Fingerprint = Util.DeviceUid;
				_reservation.ConfirmCode = Util.RandomString (4);
				_reservation.Advice = txtNotice.Text;
			
				//ServiceAgent.Reserve (_reservation);
				if (ServiceAgent.Execute(ServiceAgent.Current.ServiceClient.CreateReservationByObjectAsync, _reservation)) {
					//_hud.StartAnimating ();
					ShowHud ();
				}
			}
		}
		public ConfirmReservationController (Reservation reservation) : base ()
		{
			_reservation = reservation;
			Initialize ();
		}
Esempio n. 7
0
		private void ShowCodeConfirmView (Reservation reservation)
		{
			if (_codeConfirmViewController == null) {
				_codeConfirmViewController = new CodeConfirmViewController (reservation);
				_codeConfirmViewController.ReservationConfirmed += delegate(object sender, EventArgs<Reservation> e) {
					ShowConfirmReservationView (e.Value);
				};
				_codeConfirmViewController.ReservationAborted += delegate(object sender, EventArgs<Reservation> e) {
					ShowConfirmReservationView (e.Value);
				};
			} else {
				_codeConfirmViewController.Reservation = reservation;
			}
			
			this.PushViewController (_codeConfirmViewController);
		}
Esempio n. 8
0
		private void StartTimer (Reservation reservation)
		{
			_timer = NSTimer.CreateRepeatingScheduledTimer (TimeSpan.FromSeconds (10), 
			        delegate {
						Util.PushNetworkActive ();
						//ServiceAgent.IsDeclinedByRestaurantAsync (reservation.ReservationId);
						if (ServiceAgent.Execute (ServiceAgent.Current.ServiceClient.IsDeclinedByRestaurantAsync, _reservation.ReservationId)) {
							Util.PushNetworkActive ();
						}
				
					}
			);
		}
Esempio n. 9
0
		private void ShowConfirmReservationView (Reservation reservation)
		{
			if (_confirmReservationController == null) {
				_confirmReservationController = new ConfirmReservationController (reservation);
			} else {
				_confirmReservationController.Reservation = reservation;
			}
			this.PushViewController (_confirmReservationController);
		}