Пример #1
0
        async Task registerTime()
        {
            var baseDate = AtDate == DateTime.MinValue ? CurrentDate : AtDate;
            var param    = new ModalParameters();
            var tb       = new TimeBooking
            {
                BookingTime = baseDate.Date.AddHours(DateTime.Now.Hour).AddMinutes(DateTime.Now.Minute)
            };

            param.Add(nameof(BookTime.Booking2Change), tb);
            var ret    = Modal.Show <BookTime>("Zeit buchen", param);
            var result = await ret.Result;

            if (!result.Cancelled)
            {
                var changed = (TimeBooking)result.Data;
                //Context.TimeBookings?.Add(changed);
                //await Context.SaveChangesAsync();
                await BookingsService.AddBookingAsync(changed);

                await AppState.RegisteredAsync(changed);

                StateHasChanged();
            }
        }