public bool IsLoginNameExist(string loginName) { using (kryptonitegamingEntities db = new kryptonitegamingEntities()) { return(db.Users.Where(o => o.UserName.Equals(loginName)).Any()); } }
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(); } }
public string GetUserPassword(string loginName) { using (kryptonitegamingEntities db = new kryptonitegamingEntities()) { var user = db.Users.Where(o => o.UserName.ToLower().Equals(loginName)); if (user.Any()) { return(user.FirstOrDefault().EncryptedPassword); } else { return(string.Empty); } } }
public Account GetAccount(string ID) { using (kryptonitegamingEntities db = new kryptonitegamingEntities()) { var account = db.Accounts.Where(o => o.AccountNumber.ToLower().Equals(ID)); if (account.Any()) { return(account.FirstOrDefault()); } else { return(null); } } }
public Batch GetNextSpin() { using (kryptonitegamingEntities db = new kryptonitegamingEntities()) { var spin = db.Batches.Where(o => o.Processed.Equals(0)); if (spin.Any()) { return(spin.FirstOrDefault()); } else { return(null); } } }