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 (); } }
private void OnReservationAborteed (Reservation reservation) { if (this.ReservationAborted != null) { ReservationAborted (this, new EventArgs<Reservation> (reservation)); } }
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); } }
public CodeConfirmViewController (Reservation reservation) : this () { _reservation = reservation; }
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 (); }
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); }
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 (); } } ); }
private void ShowConfirmReservationView (Reservation reservation) { if (_confirmReservationController == null) { _confirmReservationController = new ConfirmReservationController (reservation); } else { _confirmReservationController.Reservation = reservation; } this.PushViewController (_confirmReservationController); }