public Dossier Creation_dossier(string name, DateTime d, Utulisateur user, int id) { if (Exists(name, user.Getlistdossier())) { return(null); } else { db.Insertdirectory(name, user.GetNom(), "RW", d, 0); Dossier newdirectory = new Dossier(name, d, user, null, db.lastindex()); user.AddtlistDossier(newdirectory); return(newdirectory); } }
public void Chargerlesdossier(Utulisateur user) { try { Dossier dir = new Dossier(); string smt = "SELECT Id,nom,proprietair,taille,droitacces,datecreation,emplacement FROM dbo.Dossier Where proprietair=@owner and idemplacement IS NULL or idemplacement<0"; cmd = new SqlCommand(smt, conn); cmd.Parameters.AddWithValue("@owner", user.GetNom()); SqlDataReader rs = cmd.ExecuteReader(); while (rs.Read()) { Dossier d = new Dossier(rs.GetString(1), rs.GetDateTime(5), user, null, rs.GetInt32(0)); user.AddtlistDossier(d); } rs.Close(); } catch (Exception e) { Console.WriteLine(e.Message); } }