Main.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Net;
  5. using System.Text;
  6. using System.Windows.Forms;
  7. using System.Xml.Serialization;
  8. using System.Xml.Linq;
  9. using System.Data;
  10. using Excel = Microsoft.Office.Interop.Excel;
  11. using Microsoft.AspNet.SignalR.Client;
  12. using Ionic.Utils.Zip;
  13. using System.Reflection;
  14. using System.Threading.Tasks;
  15. namespace Fuel01
  16. {
  17. public partial class Main : Form
  18. {
  19. private IHubProxy myHubproxy;
  20. private HubConnection myHubCnx;
  21. private string mySignalRiD;
  22. DataSet1.tb_epreuveDataTable tb_epr = new DataSet1.tb_epreuveDataTable();
  23. DataSet1.tb_stationDataTable tb_station = new DataSet1.tb_stationDataTable();
  24. #region Main Form
  25. public Main()
  26. {
  27. InitializeComponent();
  28. System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
  29. customCulture.NumberFormat.NumberDecimalSeparator = ".";
  30. System.Threading.Thread.CurrentThread.CurrentCulture = customCulture;
  31. }
  32. private void Main_Load(object sender, EventArgs e)
  33. {
  34. toolStripStatusLabel1_TextChanged(sender, null); // on force l'affichage de l'état
  35. Program.folder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\AsoFuel";
  36. if (!Directory.Exists(Program.folder))
  37. Directory.CreateDirectory(Program.folder);
  38. if (!Directory.Exists(Program.folder + @"\param"))
  39. Directory.CreateDirectory(Program.folder + @"\param");
  40. if (!Directory.Exists(Program.folder + @"\In"))
  41. Directory.CreateDirectory(Program.folder + @"\in");
  42. Directory.CreateDirectory(Program.folder);
  43. if (!Directory.Exists(Program.folder + @"\tmp"))
  44. Directory.CreateDirectory(Program.folder + @"\tmp");
  45. if (!Directory.Exists(Program.folder))
  46. {
  47. MessageBox.Show("Application mal installée, dossier " + Program.folder + " Non Créé, Abandon!");
  48. Application.Exit();
  49. }
  50. try
  51. {
  52. Excel.Application xlApp = new Excel.Application();
  53. xlApp.Quit();
  54. Program.isExcel = true;
  55. mnu_vehi_imp.Enabled = Program.isExcel;
  56. }
  57. catch (Exception ex)
  58. {
  59. MessageBox.Show("Application Excel non installée certaines fonctions ne seront pas disponibles!");
  60. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + "Excel non installé " + ex.Message);
  61. }
  62. if (Properties.Settings.Default.key_ope != "")
  63. {
  64. Program.key_ope = Properties.Settings.Default.key_ope;
  65. Program.nom_ope = Properties.Settings.Default.nom_ope;
  66. Program.abrev_ope = Properties.Settings.Default.abrev_ope;
  67. mnu_vehi_dow.Enabled = true;
  68. mnu_sta.Enabled = true;
  69. mnu_param.Enabled = true;
  70. mnu_saisie.Enabled = true;
  71. }
  72. tbepreuveBindingSource.DataSource = tb_epr;
  73. refreshData(1);
  74. tbepreuveBindingSource.PositionChanged += new System.EventHandler(this.tbepreuveBindingSource_PositionChanged);
  75. //PGER init_signalR();
  76. if (tb_epr.Rows.Count >= 1)
  77. {
  78. tbepreuveBindingSource.MoveLast();
  79. tbepreuveBindingSource.MoveFirst();
  80. }
  81. mnu_vehi_imp.Enabled = Program.isExcel = true ;
  82. spy();
  83. }
  84. private void Main_Activated(object sender, EventArgs e)
  85. {
  86. if (Program.key_ope != (string)this.Tag)
  87. {
  88. this.Tag = Program.key_ope;
  89. refreshData(1);
  90. }
  91. }
  92. private void Main_FormClosing(object sender, FormClosingEventArgs e)
  93. {
  94. Properties.Settings.Default.key_ope = Program.key_ope;
  95. Properties.Settings.Default.nom_ope = Program.nom_ope;
  96. Properties.Settings.Default.abrev_ope = Program.abrev_ope;
  97. Properties.Settings.Default.Save();
  98. e.Cancel = false;
  99. }
  100. private void toolStripStatusLabel1_TextChanged(object sender, EventArgs e)
  101. {
  102. if (toolStripStatusLabel1.Text == "OK")
  103. toolStripStatusLabel1.Image = global::Fuel01.Properties.Resources.green;
  104. else
  105. toolStripStatusLabel1.Image = global::Fuel01.Properties.Resources.red;
  106. //toolStripStatusLabel1.Visible = (toolStripStatusLabel1.Text == "OK");
  107. }
  108. #endregion Main Form
  109. #region Menu Principal
  110. #region operations
  111. private void opérationToolStripMenuItem_Click(object sender, EventArgs e)
  112. {
  113. }
  114. private void mnu_ope_Click(object sender, EventArgs e)
  115. {
  116. f_epreuve fepr = new f_epreuve(tb_epr);
  117. fepr.ShowDialog();
  118. mnu_vehi_dow.Enabled = true;
  119. mnu_sta.Enabled = true;
  120. }
  121. #endregion
  122. #region vehicules
  123. private void mnh_vehi_acc_Click(object sender, EventArgs e)
  124. {
  125. f_vehi fvehi = new f_vehi();
  126. fvehi.ShowDialog();
  127. }
  128. private void mnu_vehi_imp_parc_Click(object sender, EventArgs e)
  129. {
  130. f_impvehi fvehi = new f_impvehi("parc");
  131. fvehi.ShowDialog();
  132. }
  133. private void mnu_vehi_imp_tdf_Click(object sender, EventArgs e)
  134. {
  135. f_impvehi fvehi = new f_impvehi("tdf");
  136. fvehi.ShowDialog();
  137. }
  138. #endregion vehicules
  139. #region Stations
  140. f_station fsta;
  141. private void mnu_sta_Click(object sender, EventArgs e)
  142. {
  143. DataSet1.tb_stationRow mydata = null;
  144. DataRowView myrow = tbstationBindingSource.Current as DataRowView;
  145. if (myrow != null)
  146. {
  147. mydata = myrow.Row as DataSet1.tb_stationRow;
  148. fsta = new f_station(tb_station, mydata.key_sta);
  149. }
  150. else
  151. fsta = new f_station(tb_station, null);
  152. fsta.ShowDialog();
  153. }
  154. #endregion Stations
  155. #region Saisie
  156. private void mnu_saisie_Click(object sender, EventArgs e)
  157. {
  158. if (dg_sta.SelectedRows.Count != 1) return;
  159. Program.key_sta = dg_sta.SelectedRows[0].Cells[0].Value.ToString();
  160. f_saisie2 fsaisie = new f_saisie2();
  161. fsaisie.ShowDialog();
  162. }
  163. #endregion
  164. #region Gestion
  165. private void mnu_gest_Click(object sender, EventArgs e)
  166. {
  167. f_tools ftools = new f_tools();
  168. ftools.ShowDialog();
  169. }
  170. #endregion
  171. #region Paramètres
  172. private void mnu_param_Click(object sender, EventArgs e)
  173. {
  174. f_param fparam = new f_param();
  175. fparam.ShowDialog();
  176. }
  177. #endregion Paramètres
  178. #region Apropos
  179. private void mnu_about_Click(object sender, EventArgs e)
  180. {
  181. f_about fabout = new f_about();
  182. fabout.ShowDialog();
  183. }
  184. #endregion
  185. #endregion menu
  186. #region SIgnaR
  187. private async Task init_signalR()
  188. {
  189. await Task.CompletedTask;
  190. string hostname = "";
  191. string srv = "";
  192. try
  193. {
  194. try
  195. { hostname = Dns.GetHostName(); }
  196. catch (Exception ex)
  197. { hostname = "inconnu"; }
  198. if (Program.site != 1) return;
  199. Dictionary<string, string> queryStringData = new Dictionary<string, string>();
  200. mySignalRiD = DateTime.Now.Ticks.ToString();
  201. mySignalRiD= mySignalRiD.Substring(mySignalRiD.Length-5);
  202. mySignalRiD = hostname + "__" + mySignalRiD;
  203. queryStringData.Add("Login", mySignalRiD);
  204. try
  205. {
  206. myHubCnx = new HubConnection(Properties.Settings.Default.server_signalr, queryStringData);
  207. srv = Properties.Settings.Default.server_signalr;
  208. }
  209. catch (Exception ee)
  210. {
  211. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + " Connexion Secours " + srv + " impossible " + ee.Message);
  212. myHubCnx = new HubConnection("http://www.aformatix.com/SignalR/srv/", queryStringData);
  213. srv = @"http://www.aformatix.com/SignalR/srv/";
  214. }
  215. myHubproxy = myHubCnx.CreateHubProxy("PatoHub");
  216. myHubproxy.On<HubMessage>("SendNewMessage", msg => getMsg(msg));
  217. myHubCnx.StateChanged += myHubCnx_StateChanged;
  218. try
  219. {
  220. await myHubCnx.Start();
  221. Program.okSignalR = true;
  222. toolStripStatusLabel1.Text = "OK";
  223. }
  224. catch (Exception ee)
  225. {
  226. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + " Connexion à " + srv+ " impossible " + ee.Message);
  227. myHubproxy = null;
  228. Program.okSignalR = false;
  229. toolStripStatusLabel1.Text = "NOK";
  230. }
  231. }
  232. catch (Exception eee)
  233. {
  234. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + " Connexion à " + srv + " impossible " + eee.Message);
  235. }
  236. }
  237. void myHubCnx_StateChanged(StateChange obj)
  238. {
  239. if (obj.NewState != Microsoft.AspNet.SignalR.Client.ConnectionState.Connected)
  240. {
  241. Program.okSignalR = false;
  242. toolStripStatusLabel1.Text = "NOK";
  243. }
  244. else
  245. {
  246. Program.okSignalR = true;
  247. toolStripStatusLabel1.Text = "OK";
  248. }
  249. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + " de " + obj.OldState.ToString() + " à " + obj.NewState.ToString() );
  250. }
  251. private void getMsg(HubMessage hubmsg)
  252. {
  253. switch (hubmsg.Action)
  254. {
  255. case "maj":
  256. break;
  257. case "msg":
  258. string msg = hubmsg.Source + "/" + hubmsg.Action + "/" + hubmsg.Description + "/" + hubmsg.Valeur;
  259. if (hubmsg.Description == "send")
  260. {
  261. if (hubmsg.Source != mySignalRiD)
  262. sendFile(hubmsg.Valeur);
  263. }
  264. else
  265. 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);
  266. break;
  267. case "cnx":
  268. //majusers(hubmsg.Valeur);
  269. //MessageBox.Show(hubmsg.Valeur);
  270. break;
  271. }
  272. //makeTdo();
  273. }
  274. private void send_msg(string action, string valeur, string description, string[] destinataire)
  275. {
  276. try
  277. {
  278. if (!Program.okSignalR) return;
  279. //ACTION UPDATE /MESSAGE
  280. //DESCRIPTION alarme mce investigation fiche sardatas
  281. //Valeur texte du message
  282. //Destinataire = dest?
  283. 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"}
  284. myHubproxy.Invoke("DispatchMessage", mymsg);
  285. myHubproxy.Invoke("GetClients");
  286. }
  287. catch (Exception ex)
  288. {
  289. Program.traces(Program.folder + @"\tmp\traces.txt", DateTime.Now.ToString() + " Send_msg Action:"+action+" Valeur:"+valeur+" Desc:"+description+" "+ex.Message);
  290. }
  291. }
  292. #endregion SignalR
  293. #region Datas
  294. private void tbepreuveBindingSource_PositionChanged(object sender, EventArgs e)
  295. {
  296. tb_station.Clear();
  297. DataSet1.tb_epreuveRow mydata = null;
  298. DataRowView myrow = tbepreuveBindingSource.Current as DataRowView;
  299. if (myrow != null)
  300. {
  301. mydata = myrow.Row as DataSet1.tb_epreuveRow;
  302. Program.nom_ope = mydata.nom_epr;
  303. Program.key_ope = mydata.key_epr;
  304. Program.abrev_ope = mydata.abrev_epr;
  305. this.Text = Program.nom_ope;
  306. Program.subfolder = Program.folder + @"\" + Program.key_ope;
  307. if (!Directory.Exists(Program.subfolder))
  308. Directory.CreateDirectory(Program.subfolder);
  309. else
  310. {
  311. if (File.Exists(Program.subfolder + @"\station.json"))
  312. {
  313. tb_station = DbUtil.LoadFromJson<DataSet1.tb_stationDataTable>(Program.subfolder + @"\station.json", tb_station);
  314. tbstationBindingSource.DataSource = tb_station;
  315. Console.WriteLine(tb_station.Count);
  316. }
  317. //tb_station.ReadXml(Program.subfolder + @"\station.xml");
  318. }
  319. //tbstationBindingSource.DataSource = tb_station;
  320. eprstat.Text = mydata.key_epr + "-" + mydata.abrev_epr + "-" + mydata.nom_epr;
  321. }
  322. else
  323. eprstat.Text = "null";
  324. }
  325. private void refreshData(int indice)
  326. {
  327. if (indice == 1)
  328. {
  329. tb_epr=DbUtil.LoadFromJson<DataSet1.tb_epreuveDataTable>(Program.folder + @"\epreuve.json", tb_epr);
  330. tbepreuveBindingSource.DataSource = tb_epr;
  331. Console.WriteLine(tb_epr.Count);
  332. if (string.IsNullOrEmpty(Program.key_ope))
  333. {
  334. tbepreuveBindingSource.MoveFirst();
  335. DataRowView firstRow = tbepreuveBindingSource.Current as DataRowView;
  336. Program.key_ope = firstRow["key_epr"].ToString();
  337. }
  338. DataSet1.tb_epreuveRow myrow = tb_epr.FindBykey_epr(Program.key_ope);
  339. if (myrow != null)
  340. {
  341. Program.nom_ope = myrow.nom_epr;
  342. Program.key_ope = myrow.key_epr;
  343. Program.abrev_ope = myrow.abrev_epr;
  344. this.Text = Program.nom_ope;
  345. this.Tag = Program.key_ope;
  346. tbepreuveBindingSource.MoveFirst();
  347. DataRowView myRow2 = tbepreuveBindingSource.Current as DataRowView;
  348. if (myRow2 != null)
  349. while (myRow2 != null && myRow2.Row["key_epr"].ToString() != myrow["key_epr"].ToString())
  350. {
  351. tbepreuveBindingSource.MoveNext();
  352. myRow2 = myRow2 = tbepreuveBindingSource.Current as DataRowView;
  353. }
  354. }
  355. tbepreuveBindingSource.PositionChanged += new System.EventHandler(this.tbepreuveBindingSource_PositionChanged);
  356. Program.subfolder = Program.folder + @"\" + Program.key_ope;
  357. tb_station.Clear();
  358. if (!Directory.Exists(Program.subfolder))
  359. Directory.CreateDirectory(Program.subfolder);
  360. else
  361. {
  362. if (File.Exists(Program.subfolder + @"\station.json"))
  363. {
  364. tb_station = DbUtil.LoadFromJson<DataSet1.tb_stationDataTable>(Program.subfolder + @"\station.json", tb_station);
  365. }
  366. }
  367. tbstationBindingSource.DataSource = tb_station;
  368. }
  369. }
  370. private void dg_epr_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
  371. {
  372. mnu_ope_Click(dg_epr, null);
  373. }
  374. private void dg_sta_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
  375. {
  376. mnu_sta_Click(dg_sta, null);
  377. }
  378. #endregion
  379. private void bt_fact_Click(object sender, EventArgs e)
  380. {
  381. DataSet1.tb_stationRow mydata = null;
  382. DataRowView myrow = tbstationBindingSource.Current as DataRowView;
  383. if (myrow != null)
  384. {
  385. mydata = myrow.Row as DataSet1.tb_stationRow;
  386. f_facture ffac = new f_facture(mydata.key_sta);
  387. ffac.ShowDialog();
  388. }
  389. else
  390. MessageBox.Show("Pas de station séléctionée!");
  391. }
  392. private void spy()
  393. {
  394. string chemin = Properties.Settings.Default.chemin_copie_locale;
  395. try
  396. {
  397. FileSystemWatcher fw = new FileSystemWatcher(chemin, "*.xml");
  398. fw.Changed += Fw_Spy;
  399. fw.Created += Fw_Spy;
  400. fw.Deleted += Fw_Spy;
  401. fw.Renamed += Fw_Spy;
  402. fw.EnableRaisingEvents = true;
  403. }
  404. catch (Exception ex)
  405. {
  406. tslbl1.Text = " Surveillance du répertoire de réception impossible !!!";
  407. }
  408. }
  409. int nbSpy = 0;
  410. string lastSpy = "";
  411. private void Fw_Spy(object sender, FileSystemEventArgs e)
  412. {
  413. if (e.ChangeType == WatcherChangeTypes.Created)
  414. {
  415. nbSpy++;
  416. FileInfo fi = new FileInfo(e.FullPath);
  417. lastSpy = fi.CreationTime.ToString("HH:mm:ss");
  418. }
  419. tslbl1.Text = String.Format("- {0} fichier{1} créé{1} - Dernière création à {2}", nbSpy, nbSpy > 1 ? "s" : "", lastSpy);
  420. }
  421. private void button1_Click(object sender, EventArgs e)
  422. {
  423. send_msg("msg", @"C:\ProgramData\ASOFuel\7516\vehicule.xml", "send", null);
  424. send_msg("msg", @"C:\ProgramData\ASOFuel\7516\station.xml", "send", null);
  425. }
  426. private void button2_Click(object sender, EventArgs e)
  427. {
  428. if (!Program.okSignalR)
  429. init_signalR();
  430. }
  431. int timerCount = 0;
  432. int sigRCount = 0;
  433. private void timerSigR_Tick(object sender, EventArgs e)
  434. {
  435. timerSigR.Interval = 60000;
  436. if (!Program.okSignalR)
  437. init_signalR();
  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. }