Main.cs 22 KB

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