public void UpsertSpinLog(SpinLog spinLog) { using (kryptonitegamingEntities db = new kryptonitegamingEntities()) { db.SpinLogs.AddOrUpdate(spinLog); db.SaveChanges(); } }
public void UpdateAccountCredits(String ID, Decimal Amount) { using (kryptonitegamingEntities db = new kryptonitegamingEntities()) { var account = db.Accounts.Where(o => o.AccountNumber.ToLower().Equals(ID)); if (account.Any()) { account.FirstOrDefault().Credits = account.FirstOrDefault().Credits + Amount; db.SaveChanges(); } } }
public void AcceptSpin(Int32 SpinID) { using (kryptonitegamingEntities db = new kryptonitegamingEntities()) { var spin = db.Batches.Where(o => o.Id.Equals(SpinID)); if (spin.Any()) { spin.FirstOrDefault().Processed = 1; db.SaveChanges(); } } }
public void AddUserAccount(UserSignUpView user) { using (kryptonitegamingEntities db = new kryptonitegamingEntities()) { User SU = new User(); SU.UserName = user.LoginName; SU.EncryptedPassword = user.Password; SU.CreateDate = DateTime.Now; SU.LastUpdated = DateTime.Now; db.Users.Add(SU); db.SaveChanges(); } }