Advertisement
Guest User

Untitled

a guest
May 25th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. public void pay(int clientId, String status, int amount)
  2. {
  3. if ("success".Equals(status))
  4. {
  5. Korisnik user = db.Korisniks.Find(clientId);
  6. if (user.tokeni == null)
  7. {
  8. user.tokeni = amount;
  9. }
  10. else
  11. {
  12. user.tokeni += amount;
  13. }
  14. using (var dbc = new Model1())
  15. {
  16. dbc.Entry(user).State = System.Data.Entity.EntityState.Modified;
  17. dbc.SaveChanges();
  18. }
  19.  
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement