コード例 #1
0
ファイル: PaymentManager.cs プロジェクト: daya-0393/CENFOBANK
 public void Create(Payment payment)
 {
     try
     {
         credit.CreditId = payment.CreditId;
         credit.UserId   = payment.UserId;
         var creditBalance = (creditCrud.Retrieve <Credit>(credit).Balance);
         if ((creditBalance - payment.Amount) >= 0)
         {
             crudPayment.Create(payment);
         }
         else
         {
             throw new Exception("El pago excede el saldo");
         }
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
コード例 #2
0
 public Credit RetrieveById(Credit credit)
 {
     return(crudCredit.Retrieve <Credit>(credit));
 }