Exemplo n.º 1
0
        internal LoginInfo GetLoginInfo(int userId)
        {
            var param = new ParameterCollection();

            param.Add("@Id", DbType.Int32, userId);

            var result = SqlAccessor.ExecuteQuery(DatabaseSetting.Authentication.ConnectionString, DatabaseSetting.Authentication.StoredProcedures.UsersSelectByUserName,
                                                  param);

            return((result != null && result.Rows.Count > 0) ? ToLoginInfo(result.Rows[0]) : null);
        }
Exemplo n.º 2
0
        public User Get(string userName)
        {
            var param = new ParameterCollection();

            param.Add("@UserName", DbType.AnsiString, userName);

            var result = SqlAccessor.ExecuteQuery(DatabaseSetting.Authentication.ConnectionString, DatabaseSetting.Authentication.StoredProcedures.UsersSelectByUserName,
                                                  param);

            return((result != null && result.Rows.Count > 0) ? ToUser(result.Rows[0]) : null);
        }