/// <summary>
        /// Retrieves a user with information matching the current login info on the form. If no user
        /// is found, returns null.
        /// </summary>
        /// <returns></returns>
        private user ValidateLogin()
        {
            user      u       = new user();
            DataTable matches = u.Search("SELECT * FROM USERS WHERE username = '******' AND password = '******'");

            if (matches.Rows.Count > 0)
            {
                u.Load(matches.Rows[0]);
                return(u);
            }
            else
            {
                return(null);
            }
        }
        private void RefreshUserList()
        {
            user u = new user();

            foreach (DataRow aRow in u.GetAllData("username").Rows)
            {
                u = new user();
                u.Load(aRow);

                lstUsers.Items.Add(u);
            }

            if (lstUsers.Items.Count > 0)
            {
                lstUsers.SelectedIndex = 0;
            }
        }
Exemple #3
0
        /// <summary>
        /// Looks to see if any user other than the ActiveUser has a claim with the given ID open
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        internal List <user> UsersViewingClaim(bool excludeCurrentUser)
        {
            List <user> toReturn  = new List <user>();
            string      searchSQL = "SELECT * FROM users WHERE viewing_claim_id = " + id;

            if (excludeCurrentUser)
            {
                searchSQL += " AND id != " + ActiveUser.UserObject.id;
            }

            user      u;
            DataTable dt = Search(searchSQL);

            {
                foreach (DataRow aUser in dt.Rows)
                {
                    u = new user();
                    u.Load(aUser);
                    toReturn.Add(u);
                }
            }

            return(toReturn);
        }