Beispiel #1
0
        public void TestRemoveAllUsers()
        {
            access.RemoveData("user", null);
            DataTable retour = access.GetData(null, new string[] { "user" });

            Assert.IsFalse(retour.Rows.Count > 0);
        }
Beispiel #2
0
        public void TestRemoveAllUsers()
        {
            access.RemoveData("user", null);
            MySqlDataReader retour = access.GetData(null, new string[] { "user" });

            Assert.IsFalse(retour.HasRows);
            retour.Close();
        }
Beispiel #3
0
        /// <summary>
        /// renvoie la liste de tout les utilisateur present dans la table user par ordre alphabetique de leur nom
        /// </summary>
        /// <returns></returns>
        public List <User> GetUsersOrderByName()
        {
            string[] from   = { "user" };
            string[] select = { "id", "name", "password", "mail", "user_right" };
            Dictionary <string, string> where = null;
            string[] order_by = { "name" };

            List <User> retour = new List <User>();

            return(DataTableToListOfUser(access.GetData(select, from, where, order_by)));
        }
Beispiel #4
0
        /// <summary>
        /// renvoie la liste de tout les utilisateur present dans la table user par ordre alphabetique de leur nom
        /// </summary>
        /// <returns></returns>
        public List <User> GetUsersOrderByName()
        {
            string[] from   = { "user" };
            string[] select = { "id", "name", "password", "mail", "user_right" };
            Dictionary <string, string> where = null;
            string[] order_by = { "name" };

            List <User> retour = new List <User>();

            MySqlDataReader result = access.GetData(select, from, where, order_by);

            while (result.Read())
            {
                retour.Add(new User(int.Parse(result["id"].ToString()),
                                    result["name"].ToString(),
                                    result["password"].ToString(),
                                    result["mail"].ToString(),
                                    int.Parse(result["user_right"].ToString()))
                           );
            }

            return(retour);
        }