public void TestRemoveAllUsers() { access.RemoveData("user", null); DataTable retour = access.GetData(null, new string[] { "user" }); Assert.IsFalse(retour.Rows.Count > 0); }
public void TestRemoveAllUsers() { access.RemoveData("user", null); MySqlDataReader retour = access.GetData(null, new string[] { "user" }); Assert.IsFalse(retour.HasRows); retour.Close(); }
/// <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))); }
/// <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); }