Beispiel #1
0
 //Makes a deposit or withdrawal
 private string DepWith(string sType, string sUser, string sAmmount)
 {
     try
     {
         using (TransactionScope TranScope = new TransactionScope())
         {
             string sAccount = myCustomer.GetAccount(sUser);
             string sOutput  = myAccount.CalculateBalance(sType, sAccount, sAmmount);
             if (sOutput == "0")
             {
                 return("0");
             }
             string sActID = myAction.Create(sType, sAmmount);
             myTransaction.Create(sType, sAmmount, sAccount, sActID);
             return(myAccount.Update(sOutput));
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
         log.Debug(ex.ToString());
         return("-1");
     }
 }