public static double RefundOne(Latekick.BOL.AccountManagement.User u, out string BalanceMessage) { u.Balance++; BalanceMessage = "Account updated"; SaveChangesToLiveDB(u); return(u.Balance); }
public static bool RefreshBalance(Latekick.BOL.AccountManagement.User u) { ProfileCommon pc = new ProfileCommon(); ProfileCommon pb = pc.GetProfile(u.UserName); u.Currency = pb.Currency; u.Balance = pb.Balance; return(true); }
private static bool SaveChangesToLiveDB(Latekick.BOL.AccountManagement.User u) { ProfileCommon pc = new ProfileCommon(); ProfileCommon pb = pc.GetProfile(u.UserName); pb.Balance = u.Balance; pb.Save(); return(true); }
public static double PurchaseOne(Latekick.BOL.AccountManagement.User u, out string BalanceMessage) { try { if (u.Balance == 0) { BalanceMessage = "Zero balance"; } else { u.Balance--; BalanceMessage = "Account updated"; SaveChangesToLiveDB(u); } } catch { throw new PurchaseException(); } return(u.Balance); }