Example #1
0
        public static double RefundOne(Latekick.BOL.AccountManagement.User u, out string BalanceMessage)
        {
            u.Balance++;

            BalanceMessage = "Account updated";
            SaveChangesToLiveDB(u);
            return(u.Balance);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }