示例#1
0
        public string Supprimer_fichier(fichier file, bool u)
        {
            List <fichier> list = new List <fichier>();

            if (!u)
            {
                list = file.GetPropritaire().Getlistfilelist();
            }
            if (u)
            {
                list = file.GetEmplacement().Getlistoffiles();
            }

            string ok = "your file was deleted !", nok = "you can't !";


            int stop = list.Count;

            if (file.GetDroitacces().Equals("RW"))
            {
                list.Remove(file);
                db.deletefile(file.Getid());
                return(ok);
            }
            else
            {
                return(nok + "you don't have the right ");
            }
        }
示例#2
0
        public fichier(fichier f, Dossier ds)
        {
            nom         = f.GetNom();
            this.format = f.GetFormat();
            proprietair = f.GetPropritaire();
            emplacement = ds;
            taille      = 1;
            _id         = db.lastindexf() + 1;
            Blob        = f.GetBlob();
            droitacces dr = new droitacces();

            dr.Setdroitacces("RW");
            droit_acces = dr;
        }