public IActionResult Create(int?id)
        {
            var model = new CreatePaymentDetailsViewModel();

            if (id != null)
            {
                model.PaymentId = id.Value;
                return(View(model));
            }
            return(View(model));
        }
 public IActionResult Create(CreatePaymentDetailsViewModel model)
 {
     if (ModelState.IsValid)
     {
         PaymentDetails details = new PaymentDetails
         {
             PaymentId  = model.PaymentId,
             AmountPaid = model.AmountPaid,
             Date       = model.Date
         };
         _payment.AddPaymentDetail(details);
         return(View("Index"));
     }
     return(View(model));
 }