Exemple #1
0
        /*     public void SelectFile3(string theDirectory)
         *   {
         *       getrefprojet();
         *       string destinationFolder;
         *       OpenFileDialog openFileDialog1 = new OpenFileDialog();
         *       DirectoryCreator dcr = new DirectoryCreator();
         *       if (openFileDialog1.ShowDialog() == DialogResult.OK)
         *       {
         *           var fileName = openFileDialog1.FileName;
         *           destinationFolder = AppDomain.CurrentDomain.BaseDirectory + @"Projet\" + tempnumprojet + @"\Programme\" + inputRefProgramme.Text + @"\PermisLotir\" + inputNumLotir.Text + @"\" + theDirectory + @"\" + Path.GetFileName(openFileDialog1.FileName);
         *           dcr.CreateDirectoryPermisLotir(tempnumprojet, inputRefProgramme.Text, inputNumLotir.Text + "/" + theDirectory);
         *           System.Windows.Forms.MessageBox.Show("operation réussi avec succès");
         *           if (File.Exists(destinationFolder))
         *           {
         *               File.Delete(destinationFolder);
         *           }
         *
         *           File.Copy(fileName, Path.Combine(Path.GetDirectoryName(fileName), destinationFolder));
         *       }
         *       else
         *       {
         *           System.Windows.MessageBox.Show("aucun fichier selectionné");
         *       }
         *   }
         */
        private void BtnAjouterPC_Click(object sender, RoutedEventArgs e)
        {
            if (inputNumPermisConstruire.Text != "")
            {
                DirectoryCreator DC = new DirectoryCreator();
                DC.CreateDirectoryPermisConstruire(inputRefProjet.Text, inputRefProgramme.Text, inputNumPermisConstruire.Text);
                PermisDeConstruireController PDCC = new PermisDeConstruireController();
                PDCC.AjouterPermisConstruire(inputDatePermisConstruire.Text, inputNbrLog.Text, decimal.Parse(inputSupLog.Text), inputNbrLoc.Text, decimal.Parse(inputSupLoc.Text), inputNbrBur.Text, decimal.Parse(inputSupBur.Text), inputNbrCave.Text, decimal.Parse(inputSuperficieCave.Text), inputNbrCC.Text, decimal.Parse(inputSuperficieCC.Text), inputNbrPlcS.Text, decimal.Parse(inputSuperficiePlcS.Text), RefProgramme, int.Parse(inputRefProjet.Text));
                msh.LoadData("select * from permisdeconstruire where RefProgramme='" + RefProgramme + "' and NomProjet='" + inputNomProjet.Text + "'", DataGridPConstruire);
                inputNumPermisConstruire.Text = inputDatePermisConstruire.Text = inputNbrLog.Text = inputNbrLoc.Text = inputNbrBur.Text = inputNbrCave.Text = inputNbrCC.Text = inputNbrPlcS.Text = "";

                //  inputFraisPLotir.Text = "0.00";
                inputSupLog.Text = inputSupLoc.Text = inputSupBur.Text = inputSuperficieCave.Text = inputSuperficieCC.Text = inputSuperficiePlcS.Text = "0";
                msh.LoadData("select *,DATE_FORMAT(DatePermisC,'%d/%m/%y') AS Date from permisdeconstruire where RefProgramme='" + RefProgramme + "' and RefProjet='" + inputRefProjet.Text + "'", DataGridPConstruire);
            }
            else
            {
                System.Windows.MessageBox.Show("Veuillez remplir tous les champs pour ajouter un permis de construire", "Permis de construire", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Exemple #2
0
        public void SelectFile4(string theDirectory)
        {
            string           destinationFolder;
            OpenFileDialog   openFileDialog1 = new OpenFileDialog();
            DirectoryCreator dcr             = new DirectoryCreator();

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                var fileName = openFileDialog1.FileName;
                destinationFolder = AppDomain.CurrentDomain.BaseDirectory + @"Projet\" + inputRefProjet.Text + @"\Programme\" + inputRefProgramme.Text + @"\Permis de construire\" + inputNumPermisConstruire.Text + @"\" + theDirectory + @"\" + Path.GetFileName(openFileDialog1.FileName);
                dcr.CreateDirectoryPermisConstruire(inputRefProjet.Text, inputRefProgramme.Text, inputNumPermisConstruire.Text + "/" + theDirectory);
                System.Windows.Forms.MessageBox.Show("operation réussi avec succès");
                if (File.Exists(destinationFolder))
                {
                    File.Delete(destinationFolder);
                }

                File.Copy(fileName, Path.Combine(Path.GetDirectoryName(fileName), destinationFolder));
            }
            else
            {
                System.Windows.MessageBox.Show("aucun fichier selectionné");
            }
        }