Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
 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();
     }
 }
Ejemplo n.º 3
0
 public void ReadPayment()
 {
     ConsolePaymentPresenter.Present(paymentService.ReadPayments());
 }