public void UpdatePayment() { Payment payment = new Payment(); try { Console.WriteLine("Print Id: "); int id = Int32.Parse(Console.ReadLine()); Console.WriteLine("Print GuestId: "); payment.GuestId = Int32.Parse(Console.ReadLine()); Console.WriteLine("Print ReservationId: "); payment.ReservationId = Int32.Parse(Console.ReadLine()); Console.WriteLine("Print Amount: "); payment.Amount = decimal.Parse(Console.ReadLine()); Console.WriteLine("Print PayTime: "); payment.PayTime = DateTime.Parse(Console.ReadLine()); paymentService.UpdatePayment(id, payment); Console.WriteLine("Object successful updated"); ConsolePaymentPresenter.Present(paymentService.ReadPayments()); } catch (Exception ex) { Console.WriteLine(ex.Message); UpdatePayment(); } }
public void DeletePayment() { try { Console.WriteLine("Print Id: "); int id = Int32.Parse(Console.ReadLine()); paymentService.DeletePayment(id); Console.WriteLine("Object successful deleted"); ConsolePaymentPresenter.Present(paymentService.ReadPayments()); } catch (Exception ex) { Console.WriteLine(ex.Message); DeletePayment(); } }
public void ReadPayment() { ConsolePaymentPresenter.Present(paymentService.ReadPayments()); }