Main.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. using Ionic.Utils.Zip;
  2. using Microsoft.AspNet.SignalR.Client;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.IO;
  7. using System.Net;
  8. using System.Reflection;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. using Excel = Microsoft.Office.Interop.Excel;
  13. namespace Fuel01
  14. {
  15. public partial class Main : Form
  16. {
  17. private IHubProxy myHubproxy;
  18. private HubConnection myHubCnx;
  19. private string mySignalRiD;
  20. DataSet1.tb_epreuveDataTable tb_epr = new DataSet1.tb_epreuveDataTable();
  21. DataSet1.tb_stationDataTable tb_station = new DataSet1.tb_stationDataTable();
  22. #region Main Form
  23. public Main()
  24. {
  25. InitializeComponent();
  26. System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
  27. customCulture.NumberFormat.NumberDecimalSeparator = ".";
  28. System.Threading.Thread.CurrentThread.CurrentCulture = customCulture;
  29. }
  30. private void Main_Load(object sender, EventArgs e)
  31. {
  32. toolStripStatusLabel1_TextChanged(sender, null); // on force l'affichage de l'état
  33. Program.folder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\AsoFuel";
  34. if (!Directory.Exists(Program.folder))
  35. Directory.CreateDirectory(Program.folder);
  36. if (!Directory.Exists(Program.folder + @"\param"))
  37. Directory.CreateDirectory(Program.folder + @"\param");
  38. if (!Directory.Exists(Program.folder + @"\In"))
  39. Directory.CreateDirectory(Program.folder + @"\in");
  40. Directory.CreateDirectory(Program.folder);
  41. if (!Directory.Exists(Program.folder + @"\tmp"))
  42. Directory.CreateDirectory(Program.folder + @"\tmp");
  43. if (!Directory.Exists(Program.folder))
  44. {
  45. MessageBox.Show("Application mal installée, dossier " + Program.folder + " Non Créé, Abandon!");
  46. Application.Exit();
  47. }
  48. try
  49. {
  50. Excel.Application xlApp = new Excel.Application();
  51. xlApp.Quit();
  52. Program.isExcel = true;
  53. mnu_vehi_imp.Enabled = Program.isExcel;
  54. }
  55. catch (Exception ex)
  56. {
  57. MessageBox.Show("Application Excel non installée certaines fonctions ne seront pas disponibles!");
  58. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + "Excel non installé " + ex.Message);
  59. }
  60. if (Properties.Settings.Default.key_ope != "")
  61. {
  62. Program.key_ope = Properties.Settings.Default.key_ope;
  63. Program.nom_ope = Properties.Settings.Default.nom_ope;
  64. Program.abrev_ope = Properties.Settings.Default.abrev_ope;
  65. mnu_vehi_dow.Enabled = true;
  66. mnu_sta.Enabled = true;
  67. mnu_param.Enabled = true;
  68. mnu_saisie.Enabled = true;
  69. }
  70. tbepreuveBindingSource.DataSource = tb_epr;
  71. refreshData(1);
  72. tbepreuveBindingSource.PositionChanged += new System.EventHandler(this.tbepreuveBindingSource_PositionChanged);
  73. //PGER init_signalR();
  74. if (tb_epr.Rows.Count >= 1)
  75. {
  76. tbepreuveBindingSource.MoveLast();
  77. tbepreuveBindingSource.MoveFirst();
  78. }
  79. mnu_vehi_imp.Enabled = Program.isExcel = true ;
  80. spy();
  81. }
  82. private void Main_Activated(object sender, EventArgs e)
  83. {
  84. if (Program.key_ope != (string)this.Tag)
  85. {
  86. this.Tag = Program.key_ope;
  87. refreshData(1);
  88. }
  89. }
  90. private void Main_FormClosing(object sender, FormClosingEventArgs e)
  91. {
  92. Properties.Settings.Default.key_ope = Program.key_ope;
  93. Properties.Settings.Default.nom_ope = Program.nom_ope;
  94. Properties.Settings.Default.abrev_ope = Program.abrev_ope;
  95. Properties.Settings.Default.Save();
  96. e.Cancel = false;
  97. }
  98. private void toolStripStatusLabel1_TextChanged(object sender, EventArgs e)
  99. {
  100. if (toolStripStatusLabel1.Text == "OK")
  101. toolStripStatusLabel1.Image = global::Fuel01.Properties.Resources.green;
  102. else
  103. toolStripStatusLabel1.Image = global::Fuel01.Properties.Resources.red;
  104. //toolStripStatusLabel1.Visible = (toolStripStatusLabel1.Text == "OK");
  105. }
  106. #endregion Main Form
  107. #region Menu Principal
  108. #region operations
  109. private void opérationToolStripMenuItem_Click(object sender, EventArgs e)
  110. {
  111. }
  112. private void mnu_ope_Click(object sender, EventArgs e)
  113. {
  114. f_epreuve fepr = new f_epreuve(tb_epr);
  115. fepr.ShowDialog();
  116. mnu_vehi_dow.Enabled = true;
  117. mnu_sta.Enabled = true;
  118. }
  119. #endregion
  120. #region vehicules
  121. private void mnh_vehi_acc_Click(object sender, EventArgs e)
  122. {
  123. f_vehi fvehi = new f_vehi();
  124. fvehi.ShowDialog();
  125. }
  126. private void mnu_vehi_imp_parc_Click(object sender, EventArgs e)
  127. {
  128. f_impvehi fvehi = new f_impvehi("parc");
  129. fvehi.ShowDialog();
  130. }
  131. private void mnu_vehi_imp_tdf_Click(object sender, EventArgs e)
  132. {
  133. f_impvehi fvehi = new f_impvehi("tdf");
  134. fvehi.ShowDialog();
  135. }
  136. #endregion vehicules
  137. #region Stations
  138. f_station fsta;
  139. private void mnu_sta_Click(object sender, EventArgs e)
  140. {
  141. DataSet1.tb_stationRow mydata = null;
  142. DataRowView myrow = tbstationBindingSource.Current as DataRowView;
  143. if (myrow != null)
  144. {
  145. mydata = myrow.Row as DataSet1.tb_stationRow;
  146. fsta = new f_station(tb_station, mydata.key_sta);
  147. }
  148. else
  149. fsta = new f_station(tb_station, null);
  150. fsta.ShowDialog();
  151. }
  152. #endregion Stations
  153. #region Saisie
  154. private void mnu_saisie_Click(object sender, EventArgs e)
  155. {
  156. if (dg_sta.SelectedRows.Count != 1) return;
  157. Program.key_sta = dg_sta.SelectedRows[0].Cells[0].Value.ToString();
  158. f_saisie2 fsaisie = new f_saisie2();
  159. fsaisie.ShowDialog();
  160. }
  161. #endregion
  162. #region Gestion
  163. private void mnu_gest_Click(object sender, EventArgs e)
  164. {
  165. f_tools ftools = new f_tools();
  166. ftools.ShowDialog();
  167. }
  168. #endregion
  169. #region Paramètres
  170. private void mnu_param_Click(object sender, EventArgs e)
  171. {
  172. f_param fparam = new f_param();
  173. fparam.ShowDialog();
  174. }
  175. #endregion Paramètres
  176. #region Apropos
  177. private void mnu_about_Click(object sender, EventArgs e)
  178. {
  179. f_about fabout = new f_about();
  180. fabout.ShowDialog();
  181. }
  182. #endregion
  183. #endregion menu
  184. #region SIgnaR
  185. private async Task init_signalR()
  186. {
  187. await Task.CompletedTask;
  188. string hostname = "";
  189. string srv = "";
  190. try
  191. {
  192. try
  193. { hostname = Dns.GetHostName(); }
  194. catch (Exception ex)
  195. { hostname = "inconnu"; }
  196. if (Program.site != 1) return;
  197. Dictionary<string, string> queryStringData = new Dictionary<string, string>();
  198. mySignalRiD = DateTime.Now.Ticks.ToString();
  199. mySignalRiD= mySignalRiD.Substring(mySignalRiD.Length-5);
  200. mySignalRiD = hostname + "__" + mySignalRiD;
  201. queryStringData.Add("Login", mySignalRiD);
  202. try
  203. {
  204. myHubCnx = new HubConnection(Properties.Settings.Default.server_signalr, queryStringData);
  205. srv = Properties.Settings.Default.server_signalr;
  206. }
  207. catch (Exception ee)
  208. {
  209. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + " Connexion Secours " + srv + " impossible " + ee.Message);
  210. myHubCnx = new HubConnection("http://www.aformatix.com/SignalR/srv/", queryStringData);
  211. srv = @"http://www.aformatix.com/SignalR/srv/";
  212. }
  213. myHubproxy = myHubCnx.CreateHubProxy("PatoHub");
  214. myHubproxy.On<HubMessage>("SendNewMessage", msg => getMsg(msg));
  215. myHubCnx.StateChanged += myHubCnx_StateChanged;
  216. try
  217. {
  218. await myHubCnx.Start();
  219. Program.okSignalR = true;
  220. toolStripStatusLabel1.Text = "OK";
  221. }
  222. catch (Exception ee)
  223. {
  224. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + " Connexion à " + srv+ " impossible " + ee.Message);
  225. myHubproxy = null;
  226. Program.okSignalR = false;
  227. toolStripStatusLabel1.Text = "NOK";
  228. }
  229. }
  230. catch (Exception eee)
  231. {
  232. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + " Connexion à " + srv + " impossible " + eee.Message);
  233. }
  234. }
  235. void myHubCnx_StateChanged(StateChange obj)
  236. {
  237. if (obj.NewState != Microsoft.AspNet.SignalR.Client.ConnectionState.Connected)
  238. {
  239. Program.okSignalR = false;
  240. toolStripStatusLabel1.Text = "NOK";
  241. }
  242. else
  243. {
  244. Program.okSignalR = true;
  245. toolStripStatusLabel1.Text = "OK";
  246. }
  247. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + " de " + obj.OldState.ToString() + " à " + obj.NewState.ToString() );
  248. }
  249. private void getMsg(HubMessage hubmsg)
  250. {
  251. switch (hubmsg.Action)
  252. {
  253. case "maj":
  254. break;
  255. case "msg":
  256. string msg = hubmsg.Source + "/" + hubmsg.Action + "/" + hubmsg.Description + "/" + hubmsg.Valeur;
  257. if (hubmsg.Description == "send")
  258. {
  259. if (hubmsg.Source != mySignalRiD)
  260. sendFile(hubmsg.Valeur);
  261. }
  262. else
  263. MessageBox.Show(String.Format("Message de {0} \r\n {1} \r\n \r\n {2}", hubmsg.Source, hubmsg.Valeur, hubmsg.Date.ToString()), "SMS ", MessageBoxButtons.OK, MessageBoxIcon.Information);
  264. break;
  265. case "cnx":
  266. //majusers(hubmsg.Valeur);
  267. //MessageBox.Show(hubmsg.Valeur);
  268. break;
  269. }
  270. //makeTdo();
  271. }
  272. private void send_msg(string action, string valeur, string description, string[] destinataire)
  273. {
  274. try
  275. {
  276. if (!Program.okSignalR) return;
  277. //ACTION UPDATE /MESSAGE
  278. //DESCRIPTION alarme mce investigation fiche sardatas
  279. //Valeur texte du message
  280. //Destinataire = dest?
  281. HubMessage mymsg = new HubMessage { Action = action, Valeur = valeur, Description = description, Destinataires = destinataire, Date = DateTime.UtcNow.ToString("dd/MM/yy hh:mm:ss") }; //new string[]{"admin"}
  282. myHubproxy.Invoke("DispatchMessage", mymsg);
  283. myHubproxy.Invoke("GetClients");
  284. }
  285. catch (Exception ex)
  286. {
  287. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + " Send_msg Action:"+action+" Valeur:"+valeur+" Desc:"+description+" "+ex.Message);
  288. }
  289. }
  290. #endregion SignalR
  291. #region Datas
  292. private void tbepreuveBindingSource_PositionChanged(object sender, EventArgs e)
  293. {
  294. tb_station.Clear();
  295. DataSet1.tb_epreuveRow mydata = null;
  296. DataRowView myrow = tbepreuveBindingSource.Current as DataRowView;
  297. if (myrow != null)
  298. {
  299. mydata = myrow.Row as DataSet1.tb_epreuveRow;
  300. Program.nom_ope = mydata.nom_epr;
  301. Program.key_ope = mydata.key_epr;
  302. Program.abrev_ope = mydata.abrev_epr;
  303. this.Text = Program.nom_ope;
  304. Program.subfolder = Program.folder + @"\" + Program.key_ope;
  305. if (!Directory.Exists(Program.subfolder))
  306. Directory.CreateDirectory(Program.subfolder);
  307. else
  308. {
  309. if (File.Exists(Program.subfolder + @"\station.json"))
  310. {
  311. tb_station = DbUtil.LoadFromJson<DataSet1.tb_stationDataTable>(Program.subfolder + @"\station.json", tb_station);
  312. tbstationBindingSource.DataSource = tb_station;
  313. Console.WriteLine(tb_station.Count);
  314. }
  315. //tb_station.ReadXml(Program.subfolder + @"\station.xml");
  316. }
  317. //tbstationBindingSource.DataSource = tb_station;
  318. eprstat.Text = mydata.key_epr + "-" + mydata.abrev_epr + "-" + mydata.nom_epr;
  319. }
  320. else
  321. eprstat.Text = "null";
  322. }
  323. private void refreshData(int indice)
  324. {
  325. if (indice == 1)
  326. {
  327. tb_epr=DbUtil.LoadFromJson<DataSet1.tb_epreuveDataTable>(Program.folder + @"\epreuve.json", tb_epr);
  328. tbepreuveBindingSource.DataSource = tb_epr;
  329. Console.WriteLine(tb_epr.Count);
  330. if (string.IsNullOrEmpty(Program.key_ope))
  331. {
  332. tbepreuveBindingSource.MoveFirst();
  333. DataRowView firstRow = tbepreuveBindingSource.Current as DataRowView;
  334. Program.key_ope = firstRow["key_epr"].ToString();
  335. }
  336. DataSet1.tb_epreuveRow myrow = tb_epr.FindBykey_epr(Program.key_ope);
  337. if (myrow != null)
  338. {
  339. Program.nom_ope = myrow.nom_epr;
  340. Program.key_ope = myrow.key_epr;
  341. Program.abrev_ope = myrow.abrev_epr;
  342. this.Text = Program.nom_ope;
  343. this.Tag = Program.key_ope;
  344. tbepreuveBindingSource.MoveFirst();
  345. DataRowView myRow2 = tbepreuveBindingSource.Current as DataRowView;
  346. if (myRow2 != null)
  347. while (myRow2 != null && myRow2.Row["key_epr"].ToString() != myrow["key_epr"].ToString())
  348. {
  349. tbepreuveBindingSource.MoveNext();
  350. myRow2 = myRow2 = tbepreuveBindingSource.Current as DataRowView;
  351. }
  352. }
  353. tbepreuveBindingSource.PositionChanged += new System.EventHandler(this.tbepreuveBindingSource_PositionChanged);
  354. Program.subfolder = Program.folder + @"\" + Program.key_ope;
  355. tb_station.Clear();
  356. if (!Directory.Exists(Program.subfolder))
  357. Directory.CreateDirectory(Program.subfolder);
  358. else
  359. {
  360. if (File.Exists(Program.subfolder + @"\station.json"))
  361. {
  362. tb_station = DbUtil.LoadFromJson<DataSet1.tb_stationDataTable>(Program.subfolder + @"\station.json", tb_station);
  363. }
  364. }
  365. tbstationBindingSource.DataSource = tb_station;
  366. }
  367. }
  368. private void dg_epr_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
  369. {
  370. mnu_ope_Click(dg_epr, null);
  371. }
  372. private void dg_sta_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
  373. {
  374. mnu_sta_Click(dg_sta, null);
  375. }
  376. #endregion
  377. private void bt_fact_Click(object sender, EventArgs e)
  378. {
  379. DataSet1.tb_stationRow mydata = null;
  380. DataRowView myrow = tbstationBindingSource.Current as DataRowView;
  381. if (myrow != null)
  382. {
  383. mydata = myrow.Row as DataSet1.tb_stationRow;
  384. f_facture ffac = new f_facture(mydata.key_sta);
  385. ffac.ShowDialog();
  386. }
  387. else
  388. MessageBox.Show("Pas de station séléctionée!");
  389. }
  390. private void spy()
  391. {
  392. string chemin = Properties.Settings.Default.chemin_copie_locale;
  393. try
  394. {
  395. FileSystemWatcher fw = new FileSystemWatcher(chemin, "*.xml");
  396. fw.Changed += Fw_Spy;
  397. fw.Created += Fw_Spy;
  398. fw.Deleted += Fw_Spy;
  399. fw.Renamed += Fw_Spy;
  400. fw.EnableRaisingEvents = true;
  401. }
  402. catch (Exception ex)
  403. {
  404. tslbl1.Text = " Surveillance du répertoire de réception impossible !!!";
  405. }
  406. }
  407. int nbSpy = 0;
  408. string lastSpy = "";
  409. private void Fw_Spy(object sender, FileSystemEventArgs e)
  410. {
  411. if (e.ChangeType == WatcherChangeTypes.Created)
  412. {
  413. nbSpy++;
  414. FileInfo fi = new FileInfo(e.FullPath);
  415. lastSpy = fi.CreationTime.ToString("HH:mm:ss");
  416. }
  417. tslbl1.Text = String.Format("- {0} fichier{1} créé{1} - Dernière création à {2}", nbSpy, nbSpy > 1 ? "s" : "", lastSpy);
  418. }
  419. private void button1_Click(object sender, EventArgs e)
  420. {
  421. send_msg("msg", @"C:\ProgramData\ASOFuel\7516\vehicule.xml", "send", null);
  422. send_msg("msg", @"C:\ProgramData\ASOFuel\7516\station.xml", "send", null);
  423. }
  424. private void button2_Click(object sender, EventArgs e)
  425. {
  426. if (!Program.okSignalR)
  427. init_signalR();
  428. }
  429. int timerCount = 0;
  430. int sigRCount = 0;
  431. private void timerSigR_Tick(object sender, EventArgs e)
  432. {
  433. timerSigR.Interval = 60000;
  434. if (!Program.okSignalR)
  435. {
  436. _= init_signalR();
  437. }
  438. if ( checkVersion_activated && timerCount%5==0)
  439. checkVersion();
  440. timerCount++;
  441. }
  442. private void sendFile(string fileName)
  443. {
  444. string chaine = @"http://www.aformatix.com/stationservice/api/FileUpLoad/upLoadFiles";
  445. WebClient client = new WebClient();
  446. //fileName = @"C:\ProgramData\ASOFuel\7516\" + fileName;
  447. client.UploadFileAsync(new Uri(chaine), "POST", fileName);
  448. }
  449. private void splitContainer3_Panel2_MouseDoubleClick(object sender, MouseEventArgs e)
  450. {
  451. bool isVis = !bt_do.Visible;
  452. bt_retry.Visible = isVis;
  453. bt_do.Visible = isVis;
  454. bt_test.Visible = isVis;
  455. bt_doAll.Visible = isVis;
  456. text_file.Visible = isVis;
  457. toolStripStatusLabel1.Visible = isVis;
  458. }
  459. private void bt_do_Click(object sender, EventArgs e)
  460. {
  461. send_msg("msg", text_file.Text, "send", null);
  462. }
  463. private void actZip(string seek)
  464. {
  465. string path = "";
  466. string mask="";
  467. try
  468. {
  469. path = seek.Substring(0, seek.LastIndexOf("\\"));
  470. mask = seek.Substring(seek.LastIndexOf("\\") + 1);
  471. DateTime dt = DateTime.Now;
  472. string filename = Program.folder + @"\tmp\zip_" + dt.ToString("yy_MM_dd_hh_mm_ss") + ".txt";
  473. StreamWriter writer = File.CreateText(filename);
  474. var zip = new ZipFile(Program.folder + @"\tmp\zip_" + dt.ToString("yy_MM_dd_hh_mm_ss") + ".zip", writer);
  475. string tmpDir = Path.GetTempPath();
  476. if (!Directory.Exists(tmpDir))
  477. tmpDir = Environment.GetEnvironmentVariable("temp");
  478. if (!Directory.Exists(tmpDir))
  479. tmpDir = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
  480. zip.TempFileFolder = tmpDir;
  481. DirectoryInfo di = new DirectoryInfo(path);
  482. foreach (FileInfo fi in di.GetFiles(mask))
  483. {
  484. zip.AddFile(fi.FullName);
  485. }
  486. zip.Save();
  487. writer.Close();
  488. send_msg("msg", zip.Name, "send", null);
  489. }
  490. catch (Exception ex)
  491. {
  492. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + " Err Make zip - seek:" + seek + " Path:" + path +" Mask:"+mask+"\r\n"+ex.Message);
  493. }
  494. }
  495. private void bt_doAll_Click(object sender, EventArgs e)
  496. {
  497. actZip(text_file.Text);
  498. }
  499. bool checkVersion_activated = true;
  500. private void checkVersion()
  501. {
  502. string[] strVersion = AssemblyVersion.Split('.');
  503. double version = Convert.ToDouble(strVersion[0]) * 100000 + Convert.ToDouble(strVersion[1]) * 1000 + Convert.ToDouble(strVersion[2]) + Convert.ToDouble(strVersion[3]) / 10000;
  504. WebRequest request = WebRequest.Create(Properties.Settings.Default.server_adress_bin + ".txt");
  505. try
  506. {
  507. WebResponse response = request.GetResponse();
  508. StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.ASCII);
  509. string retour = sr.ReadToEnd();
  510. sr.Close();
  511. double baseVersion = 0;
  512. if (double.TryParse(retour, out baseVersion))
  513. if (baseVersion > version)
  514. if (MessageBox.Show("Veuillez lancer la mise à jour depuis le bouton MAJ\r\nde la fenêtre A Propos.\r\n Pour ne plus voir ce message, cliquer sur Annuler.", "Nouvelle version disponible", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.Cancel)
  515. checkVersion_activated = false; ;
  516. }
  517. catch (Exception e) {
  518. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() +"Check Version "+ e.Message);
  519. }
  520. }
  521. public string AssemblyVersion
  522. {
  523. get
  524. {
  525. return Assembly.GetExecutingAssembly().GetName().Version.ToString();
  526. }
  527. }
  528. private void mnu_verif_Click(object sender, EventArgs e)
  529. {
  530. f_verif verif = new f_verif();
  531. verif.ShowDialog();
  532. }
  533. private void parisNice17ToolStripMenuItem_Click(object sender, EventArgs e)
  534. {
  535. f_impvehi fvehi = new f_impvehi("nice17");
  536. fvehi.ShowDialog();
  537. }
  538. private void tbepreuveBindingSource_CurrentChanged(object sender, EventArgs e)
  539. {
  540. }
  541. }
  542. }