/// <summary> /// Initializes a new instance of the <see cref="RepositoryDatabase"/> class. /// Creates a database repository. /// Requires that the data provider is connected to a database. /// All queries will be forwarded to the data provider. /// </summary> /// </param> /// </param> public RepositoryDatabase( IDatabaseUtility databaseUtility, IConvertedPokerHandInserter convertedPokerHandInserter, IConvertedPokerHandRetriever convertedPokerHandRetriever) { _databaseUtility = databaseUtility; _convertedPokerHandRetriever = convertedPokerHandRetriever; _convertedPokerHandInserter = convertedPokerHandInserter; }
public Authenticate(IDatabaseUtility connection) { this.connection = connection; this.user = new User(this.connection); try { HttpCookie cusername = HttpContext.Current.Request.Cookies["username"]; HttpCookie cpassword = HttpContext.Current.Request.Cookies["password"]; if (cusername == null || cpassword == null) { HttpCookie cun = new HttpCookie("username"); cun.Expires = DateTime.Now.AddMonths(-1); cun.HttpOnly = true; HttpContext.Current.Response.Cookies.Add(cun); HttpCookie cpw = new HttpCookie("password"); cpw.Expires = DateTime.Now.AddMonths(-1); cpw.HttpOnly = true; HttpContext.Current.Response.Cookies.Add(cpw); } else { string username = cusername.Value; string password = cpassword.Value; if (!this.user.Login(username, password)) { HttpCookie cun = new HttpCookie("username"); cun.Expires = DateTime.Now.AddMonths(-1); cun.HttpOnly = true; HttpContext.Current.Response.Cookies.Add(cun); HttpCookie cpw = new HttpCookie("password"); cpw.Expires = DateTime.Now.AddMonths(-1); cpw.HttpOnly = true; HttpContext.Current.Response.Cookies.Add(cpw); } } }catch (DBException e) { string s = e.Message; } }
public PostListModel(IDatabaseUtility connection) : this() { this.connection = connection; }
public void SetConnection(IDatabaseUtility connection) { this.connection = connection; }
public PostImage(IDatabaseUtility connection) : this() { this.connection = connection; }
public User(IDatabaseUtility connection) : this() { this.connection = connection; }
public CategoryListModel(IDatabaseUtility connection) : this() { this.connection = connection; }
public ConvertedPokerHandInserter(IPokerHandStringConverter pokerHandStringConverter, IDatabaseUtility databaseUtility) { _databaseUtility = databaseUtility; _pokerHandStringConverter = pokerHandStringConverter; }