Advertisement
Guest User

Untitled

a guest
Dec 10th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. type Transaction() =
  2.         let mutable seqNr = 0
  3.         let mutable accNr = 0
  4.         let mutable kr = 0
  5.         let mutable cent = 0
  6.         member x.sequenceNr
  7.             with get() = seqNr
  8.             and set(value) = seqNr <- value
  9.         member x.AccountNr
  10.             with get() = accNr
  11.             and set(value) = accNr <- value
  12.         member x.amountOfKr
  13.             with get() = kr
  14.             and set(value) = kr <- value
  15.         member x.amountofCent
  16.             with get() = cent
  17.             and set(value) = cent <- value
  18.  
  19.  
  20. let dotransaction(filename:string,accountNumber:int,currentBalance:string) =    
  21.          let transactions = loadfile filename                          
  22.          let balancearr = currentBalance.Split('.')                            
  23.          let kr = System.Int32.Parse(balancearr.[0])      
  24.          let cent = System.Int32.Parse(balancearr.[1])                              
  25.          let myAcc = new MyAccount(accountNr = accountNumber, accountCent = cent, accountKr = kr)                                              
  26.          let temper = accountNumber                                                  
  27.          for itr in transactions do                                                          
  28.             match itr.AccountNr
  29.                | accountNumber -> myAcc.ChangeBalance(itr.amountOfKr,itr.amountofCent)
  30.          let result = myAcc.accountKr.ToString()+"."+myAcc.accountCent.ToString()
  31.                  result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement