private void compte_rendu_Click(object sender, RoutedEventArgs e) { string[] dirss = Directory.GetFiles($@"{System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)}\Fiche", $"{nom.Text + "_" + prenom.Text}*"); if (dirss.Length > 0) { var directory = new DirectoryInfo($@"{System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)}\Fiche"); var dernier = directory.GetFiles($"{nom.Text + "_" + prenom.Text}*").OrderByDescending(f => f.LastWriteTime).First(); ExcelManip ob3 = new ExcelManip($@"{System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)}\Fiche\{dernier.ToString()}", 1); List <LView> items = new List <LView>(); int cpt1 = 94; for (int i = 0; i < 6; i++) { if (ob3.readExcelcell(cpt1, 3) != "0") { LView a = new LView(); a.Objectif = ob3.readExcelcell(cpt1, 3); a.Evaluation = ob3.readExcelcell(cpt1, 8); a.Type = "Court terme"; items.Add(a); } cpt1++; } int cpt2 = 103; for (int i = 0; i < 6; i++) { if (ob3.readExcelcell(cpt2, 3) != "0") { LView a = new LView(); a.Objectif = ob3.readExcelcell(cpt2, 3); a.Evaluation = ob3.readExcelcell(cpt2, 8); a.Type = "Moyen terme"; items.Add(a); } cpt2++; } int cpt3 = 112; for (int i = 0; i < 6; i++) { if (ob3.readExcelcell(cpt3, 3) != "0") { LView a = new LView(); a.Objectif = ob3.readExcelcell(cpt3, 3); a.Evaluation = ob3.readExcelcell(cpt3, 8); a.Type = "Long terme"; items.Add(a); } cpt3++; } PV compte = new PV(items); compte.Show(); ob3.Close(); } else { MessageBox.Show("Aucune évaluation n'a été effectuée pour le moment.", "", MessageBoxButton.OK, MessageBoxImage.Information); } }
public void ancien(string chem) { ExcelManip obb = new ExcelManip(chem, 1); int cpt1 = 70; int cpt2 = 94; if (obb.readExcelcell(14, 11) != "0") { WriteToCell(13, 11, obb.readExcelcell(14, 11)); } for (int i = 0; i < 6; i++) { if (obb.readExcelcell(cpt2, 3) != "0") { WriteToCell(cpt1, 3, obb.readExcelcell(cpt2, 3)); WriteToCell(cpt1, 8, obb.readExcelcell(cpt2, 8)); } cpt1++; cpt2++; } cpt1 = 77; cpt2 = 103; for (int i = 0; i < 6; i++) { if (obb.readExcelcell(cpt2, 3) != "0") { WriteToCell(cpt1, 3, obb.readExcelcell(cpt2, 3)); WriteToCell(cpt1, 8, obb.readExcelcell(cpt2, 8)); } cpt1++; cpt2++; } cpt1 = 84; cpt2 = 112; for (int i = 0; i < 6; i++) { if (obb.readExcelcell(cpt2, 3) != "0") { WriteToCell(cpt1, 3, obb.readExcelcell(cpt2, 3)); WriteToCell(cpt1, 8, obb.readExcelcell(cpt2, 8)); } cpt1++; cpt2++; } obb.Close(); }