Exemplo n.º 1
0
        private async void Book_Clicked(object sender, EventArgs e)
        {
            // Get Data
            BookTicketModel bookTicket = new BookTicketModel();

            bookTicket.Key    = "00";
            bookTicket.Ticket = ticketModel;

            bookTicket.Type = type.SelectedItem.ToString();
            bookTicket.Date = date.Date.ToString();

            long total = ticketModel.Price * long.Parse(quantity.SelectedItem.ToString());

            bookTicket.Amount   = total.ToString();
            bookTicket.Status   = "Pending";
            bookTicket.Quantity = quantity.SelectedItem.ToString();

            string uid = await _firebaseAuth.GetCurrentUser();

            bookTicket.UserUID = uid;


            _firebaseDatabase.SetBooking("ticketbookings", bookTicket);

            await DisplayAlert("Booking", "Your ticket is booked", "OK");

            await Navigation.PopAsync();
        }
Exemplo n.º 2
0
        private async void Book_Clicked(object sender, EventArgs e)
        {
            BookRoomModel bookRoom = new BookRoomModel();


            bookRoom.UserUID = await _firebaseAuth.GetCurrentUser();

            bookRoom.Room   = Room;
            bookRoom.Key    = "00";
            bookRoom.Date   = getTodayDate();
            bookRoom.Amount = Room.Amount;
            bookRoom.Status = "Pending";
            bookRoom.From   = from.Date.ToLocalTime().ToShortDateString();
            bookRoom.To     = to.Date.ToLocalTime().ToShortDateString();
            bookRoom.Hotel  = BHotel;

            _firebaseDatabase.SetBooking("hotelbookings", bookRoom);

            await DisplayAlert("Booking", "Your room is booked", "OK");

            await Navigation.PopAsync();
        }