public void SelectFile() { string destinationFolder; OpenFileDialog openFileDialog1 = new OpenFileDialog(); DirectoryCreator dcr = new DirectoryCreator(); if (openFileDialog1.ShowDialog() == DialogResult.OK) { var fileName = openFileDialog1.FileName; destinationFolder = AppDomain.CurrentDomain.BaseDirectory + @"Projet\" + RefProjet.ToString() + @"\Programme\" + RefProgramme + @"\Edd\" + NumEdd + @"\" + inputNumBloc.Text + @"\" + System.IO.Path.GetFileName(openFileDialog1.FileName); string Edd = "Edd"; dcr.CreateDirectoryProgramme(RefProjet.ToString(), RefProgramme + "/" + Edd + "/" + NumEdd.ToString() + "/" + inputNumBloc.Text); System.Windows.Forms.MessageBox.Show("operation réussi avec succès"); if (File.Exists(destinationFolder)) { File.Delete(destinationFolder); } File.Copy(fileName, System.IO.Path.Combine(System.IO.Path.GetDirectoryName(fileName), destinationFolder)); } else { System.Windows.MessageBox.Show("aucun fichier selectionner"); } }
public void SelectFile(string theDirectory) { string ip = "localhost"; string destinationFolder; string destinationFolderf; OpenFileDialog openFileDialog1 = new OpenFileDialog(); DirectoryCreator dcr = new DirectoryCreator(); if (openFileDialog1.ShowDialog() == DialogResult.OK) { var fileName = openFileDialog1.FileName; destinationFolder = @"\\" + ip + @"\" + AppDomain.CurrentDomain.BaseDirectory + @"Projet\" + inputRefProjet.Text + @"\Programme\" + inputRefProgramme.Text + @"\" + theDirectory + @"\" + Path.GetFileName(openFileDialog1.FileName); destinationFolderf = ipPatchController.getpath(destinationFolder, ip); dcr.CreateDirectoryProgramme(inputRefProjet.Text, inputRefProgramme.Text + "/" + theDirectory + "/"); System.Windows.Forms.MessageBox.Show("operation réussi avec succès"); if (File.Exists(destinationFolderf)) { File.Delete(destinationFolderf); } File.Copy(fileName, Path.Combine(Path.GetDirectoryName(fileName), destinationFolderf)); } else { System.Windows.MessageBox.Show("aucun fichier selectionner"); } }
//Ajouter Programme// private void BtnAjouterProgramme_Click(object sender, RoutedEventArgs e) { DirectoryCreator DC = new DirectoryCreator(); DC.CreateDirectoryProgramme(inputRefProjet.Text, inputRefProgramme.Text); PC.AjouterProgramme(int.Parse(inputRefProjet.Text), inputNomProgramme.Text, inputSiteProgramme.Text, inputDairaProgramme.Text, inputCommuneProgramme.Text, inputNatureProgramme.Text, inputTypeProgramme.Text, inputNombredebien.Text, decimal.Parse(inputSuperficie.Text), inputTypevente.Text, decimal.Parse(inputCoutF.Text), decimal.Parse(inputTva.Text), decimal.Parse(inputCoutFTTC.Text), decimal.Parse(inputM2.Text), decimal.Parse(inputFraisAdm.Text)); AddProgramme AP = new AddProgramme(0); NavigationService.Navigate(AP); }
private void BtnAjouter_Click(object sender, RoutedEventArgs e) { string Conv = "Convention"; getrefprojet(); DirectoryCreator DC = new DirectoryCreator(); DC.CreateDirectoryProgramme(tempnumprojet, RefProgramme + "/" + Conv + "/" + inputNumDC.Text); CC.AjouterConvention(NomProjet, RefProgramme, inputNumDC.Text, inputDateDC.Text, inputNumAW.Text, inputDateAW.Text, inputDateConv.Text, inputNatureA.Text, decimal.Parse(inputSupT.Text), decimal.Parse(inputPrix.Text), inputMajoration.Text); inputNumDC.Text = inputDateDC.Text = inputNumAW.Text = inputDateAW.Text = inputDateConv.Text = inputNatureA.Text = inputMajoration.Text = ""; inputSupT.Text = inputPrix.Text = "0"; msh.LoadData("select * from Convention where RefProgramme='" + RefProgramme + "' and NomProjet='" + NomProjet + "'", dataViewConvention); }
private void BtnAjouterEdd_Click(object sender, RoutedEventArgs e) { if (dataViewListeEdd.Items.Count == 0) { string Edd = "Edd"; DirectoryCreator DC = new DirectoryCreator(); DC.CreateDirectoryProgramme(RefProjet.ToString(), RefProgramme + "/" + Edd + "/" + inputNumEDD.Text); EC.AjouterEdd(RefProjet, RefProgramme, inputDateEnreg.Text, inputVolume.Text, inputRefPub.Text, inputConservation.Text, inputNotaire.Text, inputTelNotaire.Text, inputAdresseNotaire.Text, inputNomGeo.Text, inputAddresseGeo.Text, inputTelGeo.Text, inputDateGeo.Text, inputRedicte.Text, inputNbrLog.Text, decimal.Parse(inputSupLog.Text), inputNbrLoc.Text, decimal.Parse(inputSupLoc.Text), inputNbrBur.Text, decimal.Parse(inputSupBur.Text), inputNbrCave.Text, decimal.Parse(inputSupCave.Text), inputNbrEQ.Text, decimal.Parse(inputSupEQ.Text), inputNbrPS.Text, decimal.Parse(inputSupPS.Text)); msh.LoadData("select *,DATE_FORMAT(DatePubli,'%d/%m/%y') AS Date from edd where RefProgramme='" + RefProgramme + "' and RefProjet='" + RefProjet + "'", dataViewListeEdd); inputDateEnreg.Text = inputVolume.Text = inputConservation.Text = inputNotaire.Text = inputTelNotaire.Text = inputAdresseNotaire.Text = inputNomGeo.Text = inputTelGeo.Text = inputAddresseGeo.Text = inputNbrLog.Text = inputNbrLoc.Text = inputNbrCave.Text = inputNbrEQ.Text = inputNbrPS.Text = inputNbrBur.Text = ""; inputSupLog.Text = inputSupLoc.Text = inputSupBur.Text = inputSupCave.Text = inputSupEQ.Text = inputSupPS.Text = "0"; } else { System.Windows.MessageBox.Show("Vous ne pouvez pas ajouter un nouveau EDD car il existe déja un !", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void BtnAjouterCC_Click(object sender, RoutedEventArgs e) { if (inputNumCahierCharge.Text == "" && inputSuperficieCessible.Text == "" && inputSuperficieEq.Text == "" && inputSuperficieEv.Text == "" && inputSuperficieVoirie.Text == "" && inputAutreSuperficie.Text == "") { System.Windows.MessageBox.Show("Veuillez entrer les informations nécessaire!", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error); } else if (dataViewCahierCharge.Items.Count == 0) { string CC = "Cahier des charges"; getrefprojet(); DirectoryCreator DC = new DirectoryCreator(); DC.CreateDirectoryProgramme(tempnumprojet, RefProgramme + "/" + CC + "/" + inputNumCahierCharge.Text); CCPC.AjouterCahierCharge(NomProjet, RefProgramme, inputNumCahierCharge.Text, inputDateEnreg.Text, inputVolume.Text, inputNumPubli.Text, inputDatePubli.Text, inputConservation.Text, inputNotaire.Text, inputTelNotaire.Text, inputAdresseNotaire.Text, decimal.Parse(inputSuperficieCessible.Text), decimal.Parse(inputSuperficieVoirie.Text), decimal.Parse(inputSuperficieEv.Text), decimal.Parse(inputSuperficieEq.Text), decimal.Parse(inputAutreSuperficie.Text), inputNomGeo.Text, inputAddressGeo.Text, inputTelGeo.Text); msh.LoadData("select * from cahierchargeprogramme where RefProgramme='" + RefProgramme + "' and NomProjet='" + NomProjet + "'", dataViewCahierCharge); inputNumCahierCharge.Text = inputDateEnreg.Text = inputVolume.Text = inputNumPubli.Text = inputDatePubli.Text = inputConservation.Text = inputNotaire.Text = inputTelNotaire.Text = inputAdresseNotaire.Text = inputNomGeo.Text = inputAddressGeo.Text = inputTelGeo.Text = ""; inputSuperficieCessible.Text = inputSuperficieEq.Text = inputSuperficieEv.Text = inputSuperficieVoirie.Text = inputAutreSuperficie.Text = "0"; } else { System.Windows.MessageBox.Show("Vous ne pouvez pas ajouter un nouveau cahier de charge car il existe déja un !", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void BtnEddmodificatif_Click(object sender, RoutedEventArgs e) { if (tempNumEdd == "" && inputNumEDD.Text == tempNumEdd && inputNumEDD.Text == "") { System.Windows.MessageBox.Show("Veuillez selectionner un EDD pour créer un EDD modificatif", "information", MessageBoxButton.OK, MessageBoxImage.Information); } else { string NumEddModif = ""; BiensController BS = new BiensController(); EC.AjouterEdd(RefProjet, RefProgramme, inputDateEnreg.Text, inputVolume.Text, inputRefPub.Text, inputConservation.Text, inputNotaire.Text, inputTelNotaire.Text, inputAdresseNotaire.Text, inputNomGeo.Text, inputAddresseGeo.Text, inputTelGeo.Text, inputDateGeo.Text, inputRedicte.Text, inputNbrLog.Text, decimal.Parse(inputSupLog.Text), inputNbrLoc.Text, decimal.Parse(inputSupLoc.Text), inputNbrBur.Text, decimal.Parse(inputSupBur.Text), inputNbrCave.Text, decimal.Parse(inputSupCave.Text), inputNbrEQ.Text, decimal.Parse(inputSupEQ.Text), inputNbrPS.Text, decimal.Parse(inputSupPS.Text)); string query3 = "select MAX(NumEdd) AS Num from edd where RefProjet='" + RefProjet + "' and RefProgramme='" + RefProgramme + "';"; MySqlDataReader rdr3 = null; MySqlConnection con3 = null; MySqlCommand cmd3 = null; con3 = new MySqlConnection(Database.ConnectionString()); con3.Open(); cmd3 = new MySqlCommand(query3); cmd3.Connection = con3; rdr3 = cmd3.ExecuteReader(); bool oneTime3 = true; while (rdr3.Read()) { NumEddModif = rdr3["Num"].ToString(); } System.Windows.MessageBox.Show(NumEddModif); string Edd = "Edd"; DirectoryCreator DC = new DirectoryCreator(); DC.CreateDirectoryProgramme(RefProjet.ToString(), RefProgramme + "/" + Edd + "/" + NumEddModif); BS.BiensEddModificatif(int.Parse(tempNumEdd), int.Parse(NumEddModif), int.Parse(RefProgramme), RefProjet); msh.LoadData("select *,DATE_FORMAT(DatePubli,'%d/%m/%y') AS Date from edd where RefProgramme='" + RefProgramme + "' and RefProjet='" + RefProjet + "'", dataViewListeEdd); inputDateEnreg.Text = inputVolume.Text = inputConservation.Text = inputNotaire.Text = inputTelNotaire.Text = inputAdresseNotaire.Text = inputNomGeo.Text = inputTelGeo.Text = inputAddresseGeo.Text = inputNbrLog.Text = inputNbrLoc.Text = inputNbrCave.Text = inputNbrEQ.Text = inputNbrPS.Text = inputNbrBur.Text = ""; inputSupLog.Text = inputSupLoc.Text = inputSupBur.Text = inputSupCave.Text = inputSupEQ.Text = inputSupPS.Text = "0"; } }
private void OpenFolder(string folderPath) { if (Directory.Exists(folderPath)) { ProcessStartInfo startInfo = new ProcessStartInfo { Arguments = folderPath, FileName = "explorer.exe" }; Process.Start(startInfo); } else { DirectoryCreator dcr = new DirectoryCreator(); dcr.CreateDirectoryProgramme(inputRefProjet.Text, inputRefProgramme.Text + "/"); ProcessStartInfo startInfo = new ProcessStartInfo { Arguments = folderPath, FileName = "explorer.exe" }; Process.Start(startInfo); } }
private void BtnAjouterBien_Click(object sender, RoutedEventArgs e) { try { if (inputNumLot.Text != "") { string Edd = "Edd"; DirectoryCreator DC = new DirectoryCreator(); DC.CreateDirectoryProgramme(RefProjet.ToString(), RefProgramme + "/" + Edd + "/" + NumEdd.ToString() + "/" + inputNumBloc.Text); BC.AjouterBiens(RefProgramme, RefProjet, NumEdd, inputNumIlot.Text, inputTypeBien.Text, inputNumLot.Text, inputNumBloc.Text, inputNiveau.Text, inputNbrPiece.Text, decimal.Parse(inputSurH.Text), decimal.Parse(inputSurU.Text), decimal.Parse(inputPrixHT.Text), int.Parse(inputTva.Text), decimal.Parse(inputPrixTTC.Text), inputLimiteNord.Text, inputLimiteSud.Text, inputLimiteEst.Text, inputLimiteOuest.Text, inputEtat.Text, inputTypeVente.Text); inputNumLot.Background = Brushes.White; inputNumIlot.Text = inputNumLot.Text = inputNumBloc.Text = inputNiveau.Text = inputNbrPiece.Text = inputSurH.Text = inputSurU.Text = inputLimiteEst.Text = inputLimiteNord.Text = inputLimiteOuest.Text = inputLimiteSud.Text = ""; inputPrixHT.Text = "0.00"; inputTva.Text = "0"; inputPrixTTC.Text = "0.00"; msh.LoadData("select * from biens where RefProgramme='" + RefProgramme + "' and RefProjet='" + RefProjet + "' and NumEdd='" + NumEdd + "'", dataViewListeBien); } } catch (Exception) { } }
private void OpenFolder(string folderPath) { if (Directory.Exists(folderPath)) { ProcessStartInfo startInfo = new ProcessStartInfo { Arguments = folderPath, FileName = "explorer.exe" }; Process.Start(startInfo); } else { string Edd = "Edd"; DirectoryCreator dcr = new DirectoryCreator(); dcr.CreateDirectoryProgramme(RefProjet.ToString(), RefProgramme + "/" + Edd + "/" + NumEdd.ToString() + "/" + inputNumBloc.Text); ProcessStartInfo startInfo = new ProcessStartInfo { Arguments = folderPath, FileName = "explorer.exe" }; Process.Start(startInfo); } }
private void BtnCCmodificatif_Click(object sender, RoutedEventArgs e) { if (tempNumCahierDeCharge == "") { System.Windows.MessageBox.Show("Veuillez selectionner un Cahier de charge pour créer un cahier de charge modificatif", "information", MessageBoxButton.OK, MessageBoxImage.Information); } else if (inputNumCahierCharge.Text == tempNumCahierDeCharge) { System.Windows.MessageBox.Show("Le numéro de cahier de charge existe déja veuillez introduire un nouveau numéro", "information", MessageBoxButton.OK, MessageBoxImage.Information); } else { LotController LC = new LotController(); string CC = "Cahier des charges"; getrefprojet(); DirectoryCreator DC = new DirectoryCreator(); DC.CreateDirectoryProgramme(tempnumprojet, RefProgramme + "/" + CC + "/" + inputNumCahierCharge.Text); CCPC.AjouterCahierCharge(NomProjet, RefProgramme, inputNumCahierCharge.Text, inputDateEnreg.Text, inputVolume.Text, inputNumPubli.Text, inputDatePubli.Text, inputConservation.Text, inputNotaire.Text, inputTelNotaire.Text, inputAdresseNotaire.Text, decimal.Parse(inputSuperficieCessible.Text), decimal.Parse(inputSuperficieVoirie.Text), decimal.Parse(inputSuperficieEv.Text), decimal.Parse(inputSuperficieEq.Text), decimal.Parse(inputAutreSuperficie.Text), inputNomGeo.Text, inputAddressGeo.Text, inputTelGeo.Text); LC.LotsModificatif(tempNumCahierDeCharge, inputNumCahierCharge.Text, RefProgramme, NomProjet); msh.LoadData("select * from cahierchargeprogramme where RefProgramme='" + RefProgramme + "' and NomProjet='" + NomProjet + "'", dataViewCahierCharge); inputNumCahierCharge.Text = inputDateEnreg.Text = inputVolume.Text = inputNumPubli.Text = inputDatePubli.Text = inputConservation.Text = inputNotaire.Text = inputTelNotaire.Text = inputAdresseNotaire.Text = inputNomGeo.Text = inputAddressGeo.Text = inputTelGeo.Text = ""; inputSuperficieCessible.Text = inputSuperficieEq.Text = inputSuperficieEv.Text = inputSuperficieVoirie.Text = inputAutreSuperficie.Text = "0"; } }