コード例 #1
0
        /// <summary>
        /// Block the user if s/he repeat wrong info 8 times
        /// </summary>
        /// <returns></returns>
        protected bool LinqBlockUser()
        {
            LoginTry login = (from l in smartDb.LoginTries
                              where l.Id == this.LoginTryID
                              select l).First();
            login.Block = true;

            try
            {
                smartDb.SubmitChanges(); return true;
            }
            catch { return false; }
        }
コード例 #2
0
        /// <summary>
        /// Update Data using Linq Techniques
        /// </summary>
        /// <returns></returns>
        protected bool LinqUpdateLoginTryData()
        {
            LoginTry login = (from l in smartDb.LoginTries
                              where l.Id == this.LoginTryID
                              select l).First();

            login.TriesTimes = this.Count;
            login.Status = this.LoginResult;

            try
            {
                smartDb.SubmitChanges(); return true;
            }
            catch { return false; }
        }