Пример #1
0
        public string Supprimer_dossier(Dossier directory, bool u)
        {
            string         ok = null, nok = null;
            List <Dossier> list = new List <Dossier>();

            if (!u)
            {
                list = directory.GetProprietaire().Getlistdirlist();
            }
            if (u)
            {
                list = directory.GetEmplacement().Getlistofdir();
            }

            ok  = "your directory was deleted  !";
            nok = "you can't !";


            int stop = list.Count;

            if (directory.GetDroitacces().Equals("RW"))
            {
                list.Remove(directory);
                db.deletedirectory(directory.Getid());
                return(ok);
            }
            else
            {
                return(nok + ", you don't have the right ");
            }
        }
Пример #2
0
        public void clonelist(List <Dossier> oldlist, Dossier ds)
        {
            List <Dossier> newlist = ds.Getlistofdir();

            oldlist.ForEach((item) =>
            {
                Dossier d = new Dossier(item, ds);
                item.Getlistofdir().Clear();
                item.Getlistoffiles().Clear();
                db.chargerdossierdsd(ds.GetProprietaire(), item);
                db.Chargerlesfichierdsd(ds.GetProprietaire(), item);
                newlist.Add(d);
                db.Insertdirectoryd(item.GetNom(), ds.GetProprietaire().GetNom(), "RW", item.GetDatecreation(), 0, ds.GetNom(), ds.Getid());

                clonelist(item.Getlistofdir(), d);
                f.clonelist(item.Getlistoffiles(), d);
            });
            ds.setthedlidt(newlist);
            //return newlist;
        }