public IActionResult AddReceipt([FromBody] AddReceiptModel model) { var user = _userService.GetCurrentUser(HttpContext); _receiptService.AddReceipt(user, model.ContainersId); return(Ok()); }
private void ConfirmPaymentButtonOnClick(object sender, EventArgs e) { Reservation reservation = reservationService.GetReservationByTableNumber(table.Number); if (reservation == null) { throw new Exception("Cannot find a reservation assosiated with this table"); } Random random = new Random(); int receiptId = random.Next(); receiptService.AddReceipt(receiptId, selectedPaymentMethod, tipNumericUpDown.Value, feedbackTextbox.Text.Length > 0 ? feedbackTextbox.Text : null); orderService.UpdateReceiptIdByReservationId(reservation.Id, receiptId); reservationService.DeleteById(reservation.Id); mobileView.ResetTo(new TableView(), "Tafels"); }