private void BtnAttribuerBien_Click(object sender, RoutedEventArgs e) { DirectoryCreator dcr = new DirectoryCreator(); BiensController BC = new BiensController(); dcr.CreateDirectory3(inputNumAttri.Text); AttributionController AC = new AttributionController(); AC.AjouterAttribution(inputDateAttribution.Text, inputNumClient.Text, inputNumProjet.Text, inputNumProgramme.Text, inputNatureProgramme.Text, inputTypeBien.Text, inputNumIlot.Text, inputNumLot.Text, inputNumBloc.Text, tempIdbien, inputDateDLE.Text, inputDateDLR.Text, inputRefDL.Text); BC.ModifierEtat(tempIdbien, inputEtat.Text); AddPayementController APC = new AddPayementController(); APC.AjouterPayement(inputDateAttribution.Text, int.Parse(inputNumAttri.Text), inputNumClient.Text, inputNomClient.Text, inputPrenomClient.Text, inputDateNaissance.Text, inputNumCNI.Text, int.Parse(inputNumProjet.Text), inputNomProjet.Text, int.Parse(inputNumProgramme.Text), inputNomProgramme.Text, inputNumIlot.Text, inputNumLot.Text, inputTypeBien.Text, inputNumBloc.Text, inputNiveau.Text, inputNbrPiece.Text, decimal.Parse(inputSurH.Text), decimal.Parse(inputSurU.Text), decimal.Parse(inputPrixTTC.Text), 0, decimal.Parse(inputPrixTTC.Text)); string queryL = "Select NumA from Attribution where NumA=(select MAX(NumA) from attribution)"; MySqlDataReader rdrL = null; MySqlConnection conL = null; MySqlCommand cmdL = null; conL = new MySqlConnection(Database.ConnectionString()); conL.Open(); cmdL = new MySqlCommand(queryL); cmdL.Connection = conL; rdrL = cmdL.ExecuteReader(); while (rdrL.Read()) { tempNumAttribution = int.Parse(rdrL["NumA"].ToString()); } MessageBox.Show(tempNumAttribution.ToString()); string queryL2 = "Select NumPayement from payement where NumAttribution='" + tempNumAttribution + "'"; MySqlDataReader rdrL2 = null; MySqlConnection conL2 = null; MySqlCommand cmdL2 = null; conL2 = new MySqlConnection(Database.ConnectionString()); conL2.Open(); cmdL2 = new MySqlCommand(queryL2); cmdL2.Connection = conL2; rdrL2 = cmdL2.ExecuteReader(); while (rdrL2.Read()) { tempNumPayement = int.Parse(rdrL2["NumPayement"].ToString()); } msh.ExecuteQuery("INSERT INTO `cnl` (`NumCNL`, `NumPayement`, `Etat`, `NumDeci`, `DateDeci`, `MontantCNL`, `DateConservation`, `DateControle`, `DateReserve`) VALUES (NULL, '" + tempNumAttribution + "', 'Non Admis', '', NULL, NULL, NULL, NULL, NULL)"); msh.ExecuteQuery("INSERT INTO `creditb` (`NumCB`, `NumPayement`, `NumConvBan`, `DateConv`, `NomBanque`, `BIC`, `MontantCb`) VALUES (NULL, '" + tempNumAttribution + "', '', NULL, '', '', NULL)"); msh.ExecuteQuery("INSERT INTO `fnpos` (`NumFNPOS`, `NumPayement`, `NumDeciF`, `DateDeciF`, `MontantFNPOS`) VALUES (NULL, '" + tempNumAttribution + "', NULL, NULL, NULL)"); BtnAttribuerBien.IsEnabled = false; Attribution A = new Attribution(""); this.NavigationService.Navigate(A); }
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.CreateDirectory3(NumAttribution.ToString() + "/"); ProcessStartInfo startInfo = new ProcessStartInfo { Arguments = folderPath, FileName = "explorer.exe" }; Process.Start(startInfo); } }