コード例 #1
0
 public bool IsLoginNameExist(string loginName)
 {
     using (kryptonitegamingEntities db = new kryptonitegamingEntities())
     {
         return(db.Users.Where(o => o.UserName.Equals(loginName)).Any());
     }
 }
コード例 #2
0
 public void UpsertSpinLog(SpinLog spinLog)
 {
     using (kryptonitegamingEntities db = new kryptonitegamingEntities())
     {
         db.SpinLogs.AddOrUpdate(spinLog);
         db.SaveChanges();
     }
 }
コード例 #3
0
 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();
         }
     }
 }
コード例 #4
0
 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();
         }
     }
 }
コード例 #5
0
        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();
            }
        }
コード例 #6
0
 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);
         }
     }
 }
コード例 #7
0
 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);
         }
     }
 }
コード例 #8
0
 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);
         }
     }
 }