private async void OpenCurrentItem(object value) { if (!(value is BookingSummaryViewObject reservation)) { return; } if (string.IsNullOrEmpty(reservation.ClientCode)) { return; } try { var id = reservation.BookingNumber; var tabName = "Reserva." + id; CreateNewItem(tabName); var provider = await _bookingDataService.GetDoAsync(id).ConfigureAwait(false); var currentPayload = BuildShowPayLoadDo(tabName, provider); currentPayload.DataObject = provider; currentPayload.Subsystem = DataSubSystem.BookingSubsystem; currentPayload.PrimaryKeyValue = id; currentPayload.Sender = ViewModelUri.ToString(); EventManager.NotifyObserverSubsystem(BookingModule.BookingSubSystem, currentPayload); } catch (Exception ex) { DialogService?.ShowErrorMessage(ex.Message); } }
/// <summary> /// This open a current item value. /// Asyc void shall be considered bad always /// except when used through command.s /// </summary> /// <param name="value">value recevied</param> private async void OpenCurrentItem(object value) { if (!(value is BookingSummaryDto reservation)) { return; } if (string.IsNullOrEmpty(reservation.ClientCode)) { return; } var name = reservation.ClientCode; var id = reservation.BookingNumber; var tabName = "Reserva." + id; MessageBox.Show("Tets"); CreateNewItem(tabName); var provider = await _bookingDataService.GetDoAsync(id).ConfigureAwait(false); var currentPayload = BuildShowPayLoadDo(tabName, provider); currentPayload.DataObject = provider; currentPayload.Subsystem = DataSubSystem.BookingSubsystem; currentPayload.PrimaryKeyValue = id; //ActiveSubSystem(); currentPayload.Sender = ViewModelUri.ToString(); EventManager.NotifyObserverSubsystem(BookingModule.BookingSubSystem, currentPayload); }
public async Task Should_Load_AValidReservation() { var codigo = string.Empty; using (var dbConnection = SqlExecutor.OpenNewDbConnection()) { var connection = await dbConnection.GetPagedAsync <RESERVAS1>(1, 2).ConfigureAwait(false); var item = connection.FirstOrDefault <RESERVAS1>(); codigo = item.NUMERO_RES; } IBookingData booking = null; Stopwatch start = new Stopwatch(); start.Start(); booking = await _bookingDataServices.GetDoAsync(codigo).ConfigureAwait(false); //Assert.DoesNotThrowAsync(async () => booking = await _bookingDataServices.GetDoAsync(codigo).ConfigureAwait(false)); var elapse = start.ElapsedMilliseconds; start.Stop(); TestContext.Out.WriteLine("Elapsed booking retrieval time " + elapse); Assert.NotNull(booking); Assert.IsTrue(booking.Valid); Assert.NotNull(booking.Value); Assert.AreEqual(booking.Value.NUMERO_RES, codigo); }
public async Task <bool> ConfirmBooking(string code) { var retCode = false; if (_dialogService.ShowConfirmMessage("Confirm Booking", "Are you sure to confirm the booking?")) { var currentBooking = await _dataService.GetDoAsync(code).ConfigureAwait(false); if (currentBooking.Valid) { var value = currentBooking.Value; value.CONFIRMADA_RES2 = "1"; currentBooking.Value = value; retCode = await _dataService.SaveAsync(currentBooking); } } return(retCode); }