public PaymentDetails UpdatePaymentDetails(PaymentDetails pd)
        {
            var pdToUpdate = _db.PaymentDetails.FirstOrDefault(p => p.Id == pd.Id);

            pdToUpdate.AmountPaid = pd.AmountPaid;
            pdToUpdate.Date       = pd.Date;

            _db.PaymentDetails.Update(pdToUpdate);
            _db.SaveChanges();
            return(pd);
        }
        //PAYMENT DETAILS


        public PaymentDetails AddPaymentDetail(PaymentDetails pd)
        {
            _db.PaymentDetails.Add(pd);
            _db.SaveChanges();
            return(pd);
        }
 public PaymentDetails RemovePaymentDetail(PaymentDetails pd)
 {
     _db.PaymentDetails.Remove(pd);
     _db.SaveChanges();
     return(pd);
 }