Example #1
0
        /// <summary>
        /// supprime un utilisateur de la table user
        /// </summary>
        /// <param name="userId">id de l'utilisateur à supprimer</param>
        /// <returns>retourne le code d'erreur de l'execution de la requete via query.ExecuteNonQuery()</returns>
        public int RemoveUser(int userId)
        {
            Dictionary <string, string> clauseWhere = new Dictionary <string, string>();

            clauseWhere.Add("id", userId.ToString());
            return(access.RemoveData("user", clauseWhere));
        }
Example #2
0
        public void TestRemoveAllUsers()
        {
            access.RemoveData("user", null);
            DataTable retour = access.GetData(null, new string[] { "user" });

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

            Assert.IsFalse(retour.HasRows);
            retour.Close();
        }