/// <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; } }
/// <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; } }