示例#1
0
        public DirectoryInfo CreerDossier(Boolean Forcer = false)
        {
            try
            {
                String DossierGED = Societe.UtilisateurCourant.Dossier_GED;

                if (Directory.Exists(DossierGED) && (Dossier == null))
                {
                    String Chemin = Path.Combine(DossierGED, NomDossierClient());

                    DirectoryInfo pDossier = Directory.CreateDirectory(Chemin);

                    //CreerStructureDossier();

                    return(pDossier);
                }

                if (Forcer && (Dossier != null))
                {
                    String Chemin = Path.Combine(DossierGED, NomDossierClient());
                    if (Dossier.FullName != Chemin)
                    {
                        Dossier.MoveTo(Chemin);
                    }

                    return(Dossier);
                }
            }
            catch { }

            return(null);
        }
示例#2
0
        public DirectoryInfo CreerDossier(Boolean Forcer = false)
        {
            DirectoryInfo pDossierIndice = null;

            try
            {
                if (Client.Dossier == null)
                {
                    Client.CreerDossier();
                }

                DirectoryInfo pDossierClient = Client.Dossier;
                String        Chemin         = Path.Combine(pDossierClient.FullName, NomDossierDevis);

                if ((pDossierClient != null) && (Dossier == null))
                {
                    DirectoryInfo pDossierDevis = Directory.CreateDirectory(Chemin);

                    // Dossier de l'indice
                    Chemin         = Path.Combine(pDossierDevis.FullName, NomDossierIndice);
                    pDossierIndice = Directory.CreateDirectory(Chemin);
                }

                if (Forcer && (Dossier != null))
                {
                    if (Dossier.FullName != Chemin)
                    {
                        Dossier.MoveTo(Chemin);
                    }

                    pDossierIndice = DossierIndice;
                }

                if (pDossierIndice == null)
                {
                    // Dossier de l'indice
                    Chemin         = Path.Combine(Dossier.FullName, NomDossierIndice);
                    pDossierIndice = Directory.CreateDirectory(Chemin);
                }

                CreerStructureDossier();
            }
            catch { }

            return(pDossierIndice);
        }