示例#1
0
        public List <Dossier> Searchuser(string nom, Utulisateur user)
        {
            List <Dossier> ds   = new List <Dossier>();
            string         nom2 = nom;
            int            i    = 0;

            if (user.Getlistdossier() != null)
            {
                int p = user.Getlistdossier().Length;
                while (i < p)
                {
                    if (user.Getlistdossier()[i].GetNom().Equals(nom))
                    {
                        ds.Add(user.Getlistdossier()[i]);
                    }
                    //ds =  Searchussersdirectory(nom2, user.Getlistdossier()[i], user,ds);
                    i++;
                }
                return(ds);
            }
            else
            {
                return(ds);
            }
        }
示例#2
0
        public Dossier getthefolder(string name, Utulisateur user)
        {
            Dossier[] list = user.Getlistdossier();
            int       i    = 0;
            int       stop = list.Length - 1;

            while (i < stop)
            {
                Dossier d = list[i];
                string  nom;
                while ((d != null) && (i < stop))

                {
                    nom = d.GetNom().Trim();
                    if (nom.Equals(name))
                    {
                        return(d);
                    }
                    else
                    {
                        i++;
                    }
                }
                return(null);
            }
            return(null);
        }
示例#3
0
        public void Chargerlesdossierdsd(Utulisateur u)
        {
            int stop = u.Getlistdossier().Length - 1;
            int i    = 0;

            if (stop == 0)
            {
                return;
            }
            else
            {
                while (stop > i)

                {
                    chargerdossierdsd(u, u.Getlistdossier()[i]);
                    i++;
                }
            }
        }
示例#4
0
        public void chargerlesfichier(Utulisateur user)
        {
            int stop = user.Getlistdossier().Length - 1;
            int i    = 0;

            if (stop == 0)
            {
                return;
            }
            else
            {
                while (stop > i)

                {
                    Chargerlesfichierdsd(user, user.Getlistdossier()[i]);
                    i++;
                }
            }
        }
示例#5
0
        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);
            }
        }
示例#6
0
    public bool Exists(Utulisateur user, string name)
    {
        Dossier[] list = user.Getlistdossier();
        int       i    = 0;
        int       stop = list.Length;

        stop--;
        while (i <= stop)
        {
            while ((list[i] != null))
            {
                if (list[i].GetNom().Equals(name))
                {
                    return(true);
                }
                i++;
                break;
            }
        }
        return(false);
    }
示例#7
0
    public void Showmyinfos(Utulisateur user)
    {
        int i    = 0;
        int stop = Getlistdossier().Length;

        stop--;

        while (i <= stop)
        {
            while (user.Getlistdossier()[i] != null)
            {
                Console.WriteLine(i + 1 + "-" + user.Getlistdossier()[i].GetNom() +
                                  "-" + user.Getlistdossier()[i].GetProprietaire().GetNom() +
                                  "-" + user.Getlistdossier()[i].GetDroitacces() + "-" +
                                  user.Getlistdossier()[i].GetTaille() + "-" + user.Getlistdossier()[i].GetDatecreation());
                i++;
                break;
            }
        }

        return;
    }