Pilulier.xaml.cs 54.7 KB
Newer Older
Mohamed Guirat's avatar
Mohamed Guirat committed
1
2
3
4
5
6
7
8
9
10
11
using consignelaWpf.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;
Mohamed Guirat's avatar
Mohamed Guirat committed
12
13
14
using Microsoft.Office.Interop.Excel;
using System.Data;
using System.Diagnostics;
Mohamed Guirat's avatar
Mohamed Guirat committed
15
16
17
18
19
20

namespace consignelaWpf.pages
{
    /// <summary>
    /// Interaction logic for Pilulier.xaml
    /// </summary>
Mohamed Guirat's avatar
Mohamed Guirat committed
21
    public partial class Pilulier : System.Windows.Controls.Page
Mohamed Guirat's avatar
Mohamed Guirat committed
22
23
24
25
26
    {
        internal Medicament medicamentChoisi;
        internal Prescription prescriptionTmp;
        private Prescription prescriptionTmp2;
        internal List<Medicament> listMedicament = new List<Medicament>();
Mohamed Guirat's avatar
Mohamed Guirat committed
27
        internal List<Medicament> listMedicamentCloned = new List<Medicament>();
Mohamed Guirat's avatar
Mohamed Guirat committed
28
        internal List<ListView> gridViewTabMedicament = new List<ListView>();
Mohamed Guirat's avatar
Mohamed Guirat committed
29
        internal List<ListView> gridViewTabMedicamentAffiche = new List<ListView>();
Mohamed Guirat's avatar
Mohamed Guirat committed
30
        internal List<List<Medicament>> tabListMedicaments = new List<List<Medicament>>();
Mohamed Guirat's avatar
Mohamed Guirat committed
31
32
33
34
        internal List<Medicament> tabListMedicamentsAffich;
        internal List<int> nbrPilules = new List<int>();


Mohamed Guirat's avatar
Mohamed Guirat committed
35
36
37
38
39
40
41
42
43
44
        internal List<bool> open = new List<bool>();
        int j;
        bool singleTap,doubleTap, nvMedicament, mediSelected = false;
        internal String openCase = "";
        internal Medicament medicamentSelect;
        internal int indexMediSelect;
        internal int IndexgridviewSelect;
        Resultat resultatFinal;
        internal ExperiencePrescResult ExpPrescResulat;
        internal List<ExperiencePrescResult> ListExpPrescResulat = new List<ExperiencePrescResult>();
Mohamed Guirat's avatar
Mohamed Guirat committed
45
46
        internal List<ExperienceConf> ListExpConf = new List<ExperienceConf>();
        internal List<ExperienceConf> ListExperiencesConfTmp;
Mohamed Guirat's avatar
Mohamed Guirat committed
47
48
        public String sampleFileExp;
        string pathFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
Mohamed Guirat's avatar
Mohamed Guirat committed
49
50
51
52
53
54
55
56
57
        String sampleFileExperienceConf;
        internal String strJsonExpConf;
        internal int indexExp;
        String storageDirectory, ExcelDirectory;
        internal PrescriptionTab prescriptionTab = App.prescriptionTabSelect;
        internal int i;
        private Stopwatch _stopwatch;
        private int elapsedMs;
        int nbrAffPresc = 1, nbrAffPil = 1;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
58
        internal List<Etape> listEtapes = new List<Etape>();
Mohamed Guirat's avatar
Mohamed Guirat committed
59
60
61
62
63
64
65
66

        Microsoft.Office.Interop.Excel.Application excel;
        Microsoft.Office.Interop.Excel.Workbook worKbooK;
        Microsoft.Office.Interop.Excel.Worksheet worKsheeT;
        Microsoft.Office.Interop.Excel.Range celLrangE;

        System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
        
Mohamed Guirat's avatar
Mohamed Guirat committed
67
68
69
70
71
72
73
74


        public Pilulier()
        {
            InitializeComponent();
        }
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
Mohamed Guirat's avatar
Mohamed Guirat committed
75
            
Mohamed Guirat's avatar
Mohamed Guirat committed
76
            chargerListMedicament();
Mohamed Guirat's avatar
Mohamed Guirat committed
77
78
79
            listMedicamentCloned = new List<Medicament>(listMedicament);
            //listMedicament.CopyTo(listMedicamentCloned);
            //listMedicamentCloned = listMedicament.Select(i => i.Clone()).ToList();
Mohamed Guirat's avatar
Mohamed Guirat committed
80
81
82
            gridViewBoiteMedicaments.ItemsSource = listMedicament;
            gridViewNomsMedicaments.ItemsSource = listMedicament;
            loadGridView();
Mohamed Guirat's avatar
Mohamed Guirat committed
83
84
            loadGridViewAffich();
            loadPrescription();
Mohamed Guirat's avatar
Mohamed Guirat committed
85
86
            loadTabListMedicaments();
            loadOpen();
Mohamed Guirat's avatar
Mohamed Guirat committed
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
            loadExperienceConf();
            loadPrescriptionVerbale();
            if (App.format == "tab")
            {
                prescriptionTabulaire.Visibility = Visibility.Visible;
                prescriptionVerbale.Visibility = Visibility.Collapsed;
            }
            else if(App.format == "verb")
            {
                prescriptionTabulaire.Visibility = Visibility.Collapsed;
                prescriptionVerbale.Visibility = Visibility.Visible;
            }
            AfficheDate.Text = "Date : "+App.date;

            _stopwatch = Stopwatch.StartNew();
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
102
            saveEvent("Appui boutonDEBUT", "Déclenchement du chronomètre & Affichage1 PRESCRIPTION", "");
Mohamed Guirat's avatar
Mohamed Guirat committed
103
            //exportToExcel();
Mohamed Guirat's avatar
Mohamed Guirat committed
104
105
106
107
108
109

            if (App.navigation == "activee")
                RetourPrescription.Visibility = Visibility.Visible;
            else if (App.navigation == "desactivee")
                RetourPrescription.Visibility = Visibility.Collapsed;

Mohamed Guirat's avatar
Mohamed Guirat committed
110
111
112


            storageDirectory = System.IO.Path.Combine(pathFolder, "Consignela");
Mohamed Guirat's avatar
Mohamed Guirat committed
113
114
            Directory.CreateDirectory(storageDirectory);
            sampleFileExp = System.IO.Path.Combine(storageDirectory, "ExperiencePrescResult.json");
Mohamed Guirat's avatar
Mohamed Guirat committed
115
116
117
118

            ExcelDirectory = System.IO.Path.Combine(storageDirectory, "Fichiers_Excel");
            Directory.CreateDirectory(ExcelDirectory);
        }
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
119
        public void saveEvent(String action, String codageEvent,String comment)
Mohamed Guirat's avatar
Mohamed Guirat committed
120
121
122
        {
            int tempsEcoule = (int)_stopwatch.ElapsedMilliseconds;
            Etape nouvelleEtape = new Etape { Temps_ecoule = tempsEcoule, Action = action, Codage_evenement = codageEvent };
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
123
            listEtapes.Add(nouvelleEtape);
Mohamed Guirat's avatar
Mohamed Guirat committed
124
125
126
127
128
129
130
            System.Diagnostics.Debug.WriteLine(nouvelleEtape.Temps_ecoule+" "+nouvelleEtape.Action+" "+nouvelleEtape.Codage_evenement);
        }
        public void loadPrescriptionVerbale()
        {
            ListViewPrescVerbale.ItemsSource = null;
            ListViewPrescVerbale.ItemsSource = listMedicament;
        }
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
131
132
133
134
135
        //public void timer()
        //{
        //    dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
        //    dispatcherTimer.Interval = new TimeSpan(0, 0, 0,0,1);
        //    dispatcherTimer.Start();
Mohamed Guirat's avatar
Mohamed Guirat committed
136

Mohamed Guirat's avatar
events    
Mohamed Guirat committed
137
138
139
140
141
        //}
        //private void dispatcherTimer_Tick(object sender, EventArgs e)
        //{
        //    System.Diagnostics.Debug.WriteLine(dispatcherTimer.Interval.Milliseconds);
        //}
Mohamed Guirat's avatar
Mohamed Guirat committed
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
        public void loadExperienceConf()
        {
            var storageDirectory = System.IO.Path.Combine(pathFolder, "Consignela");

            sampleFileExperienceConf = System.IO.Path.Combine(storageDirectory, "ExperienceConf.json");

            //var ExperienceConf = File.Create(sampleFileExperienceConf);
            //ExperienceConf.Close();


            if (File.Exists(sampleFileExperienceConf))
            {
                strJsonExpConf = File.ReadAllText(sampleFileExperienceConf);
                ListExperiencesConfTmp = JsonConvert.DeserializeObject<List<ExperienceConf>>(strJsonExpConf);
            }

            if (ListExperiencesConfTmp != null)
            {
                indexExp = ListExperiencesConfTmp[ListExperiencesConfTmp.Count - 1].id + 1;
            }
            else
            {
                indexExp = 0;
            }
            //newListPrescriptions.Reverse();                
Mohamed Guirat's avatar
Mohamed Guirat committed
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
        }
        public void loadGridView()
        {
            gridViewTabMedicament.Add(gridViewTabMedicament11);
            gridViewTabMedicament.Add(gridViewTabMedicament12);
            gridViewTabMedicament.Add(gridViewTabMedicament13);
            gridViewTabMedicament.Add(gridViewTabMedicament14);
            gridViewTabMedicament.Add(gridViewTabMedicament15);
            gridViewTabMedicament.Add(gridViewTabMedicament16);
            gridViewTabMedicament.Add(gridViewTabMedicament17);
            gridViewTabMedicament.Add(gridViewTabMedicament21);
            gridViewTabMedicament.Add(gridViewTabMedicament22);
            gridViewTabMedicament.Add(gridViewTabMedicament23);
            gridViewTabMedicament.Add(gridViewTabMedicament24);
            gridViewTabMedicament.Add(gridViewTabMedicament25);
            gridViewTabMedicament.Add(gridViewTabMedicament26);
            gridViewTabMedicament.Add(gridViewTabMedicament27);
            gridViewTabMedicament.Add(gridViewTabMedicament31);
            gridViewTabMedicament.Add(gridViewTabMedicament32);
            gridViewTabMedicament.Add(gridViewTabMedicament33);
            gridViewTabMedicament.Add(gridViewTabMedicament34);
            gridViewTabMedicament.Add(gridViewTabMedicament35);
            gridViewTabMedicament.Add(gridViewTabMedicament36);
            gridViewTabMedicament.Add(gridViewTabMedicament37);
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
        public void loadGridViewAffich()
        {
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage11);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage12);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage13);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage14);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage15);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage16);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage17);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage21);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage22);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage23);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage24);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage25);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage26);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage27);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage31);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage32);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage33);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage34);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage35);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage36);
            gridViewTabMedicamentAffiche.Add(gridViewTabMedicamentAffichage37);
        }
        public void loadPrescription()
        {
         
            listMedicament = prescriptionTmp.medicaments;
            foreach(Medicament medicament in listMedicament)
            {

                nbrPilules.Add(medicament.nbr);
                
            }
            //tbId.Text = prescriptionTmp.nom;
            if (prescriptionTmp != null)
            {
                listMedicament = prescriptionTmp.medicaments;


                gridViewNomsMedicaments.ItemsSource = null;
                gridViewNomsMedicaments.ItemsSource = listMedicament;


                for (int i = 0; i < 21; i++)
                {
                    if (prescriptionTab.momentJour[i].listMedicaments.Count != 0)
                    {
                        tabListMedicamentsAffich = prescriptionTab.momentJour[i].listMedicaments;
                        gridViewTabMedicamentAffiche[i].ItemsSource = null;
                        gridViewTabMedicamentAffiche[i].ItemsSource = tabListMedicamentsAffich;
                    }
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
        public void loadTabListMedicaments()
        {
            for (int i = 0; i < 21; i++)
            {
                tabListMedicaments.Add(new List<Medicament>());
            }

        }
        public void loadOpen()
        {
            for (int i = 0; i < 21; i++)
            {
                open.Add(false);
            }
        }
        public void chargerListMedicament()
        {
            prescriptionTmp2 = App.prescriptionSelect;
            prescriptionTmp = prescriptionTmp2;


            foreach (Medicament medicament in prescriptionTmp.medicaments)
            {
                listMedicament.Add(medicament);
            }
        }

        private void RetourPrescription_Click(object sender, RoutedEventArgs e)
        {
Mohamed Guirat's avatar
Mohamed Guirat committed
276
277
278
            
            PilulierPanel.Visibility = Visibility.Collapsed;
            PrescriptonAffichage.Visibility = Visibility.Visible;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
279
            saveEvent("Appui ButtonPrescritpion", "Affichage" + nbrAffPresc + "Prescription","");
Mohamed Guirat's avatar
Mohamed Guirat committed
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
            nbrAffPresc++;

        }
             

        private void exportToExcel()
        {
            var ExcelFile = System.IO.Path.Combine(pathFolder, "Consignela","Fichiers_Excel", App.codeParticipant);

            //sampleFile = System.IO.Path.Combine(ExcelDirectory, "ConsignesData.json");

            Microsoft.Office.Interop.Excel.Application xla = new Microsoft.Office.Interop.Excel.Application();
            Workbook wb = xla.Workbooks.Add(XlSheetType.xlWorksheet);
            Worksheet ws = (Worksheet)xla.ActiveSheet;

            xla.Visible = false;
            ws.Cells[1, 1] = "Expérimentateur";
            ws.Cells[2, 1] = "Date";
            ws.Cells[3, 1] = "Code Participant";
            ws.Cells[4, 1] = "Type";
            ws.Cells[5, 1] = "Utilisation";
            ws.Cells[6, 1] = "Pilulier";
            ws.Cells[7, 1] = "Format";
            ws.Cells[8, 1] = "Mode";
            ws.Cells[9, 1] = "Navigation";


            ws.Cells[1,2] = App.experimentateur;
            ws.Cells[2, 2] = App.date;
            ws.Cells[3, 2] = App.codeParticipant;
            ws.Cells[4, 2] = App.type;
            ws.Cells[5, 2] = App.utilisation;
            ws.Cells[6, 2] = App.pilulier;
            ws.Cells[7, 2] = App.format;
            ws.Cells[8, 2] = App.mode;
            ws.Cells[9, 2] = App.navigation;

            Worksheet wsEvent = (Worksheet)xla.Worksheets.Add();

            wsEvent.Cells[1, 1] = "Temps Ecoule";
            wsEvent.Cells[1, 2] = "Action";
            wsEvent.Cells[1, 3] = "Codage evenement";


            Worksheet wsPilulier = (Worksheet)xla.Worksheets.Add();
            wsPilulier.Cells[2, 3] = "Lundi";
            wsPilulier.Cells[2, 4] = "Mardi";
            wsPilulier.Cells[2, 5] = "Mercredi";
            wsPilulier.Cells[2, 6] = "Jeudi";
            wsPilulier.Cells[2, 7] = "Vendredi";
            wsPilulier.Cells[2, 8] = "Samedi";
            wsPilulier.Cells[2, 9] = "Dimanche";

            wsPilulier.Cells[3, 2] = "Matin";
            wsPilulier.Cells[4, 2] = "Midi";
            wsPilulier.Cells[5, 2] = "Soir";
            wsPilulier.Cells[7, 2] = "Matin";
            wsPilulier.Cells[8, 2] = "Midi";
            wsPilulier.Cells[9, 2] = "Soir";
            wsPilulier.Cells[11, 2] = "Matin";
            wsPilulier.Cells[12, 2] = "Midi";
            wsPilulier.Cells[13, 2] = "Soir";
            wsPilulier.Cells[15, 2] = "Matin";
            wsPilulier.Cells[16, 2] = "Midi";
            wsPilulier.Cells[17, 2] = "Soir";




            //        wb.SaveAs(ExcelFile + ".xls", Excel.XlFileFormat.xlOpenXMLWorkbook, Missing.Value,
            //Missing.Value, false, false, Excel.XlSaveAsAccessMode.xlNoChange,
            //Excel.XlSaveConflictResolution.xlUserResolution, true,
            //Missing.Value, Missing.Value, Missing.Value);

            wb.SaveAs(ExcelFile+".xls", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal);
            wb.Close();
            xla.Quit();
Mohamed Guirat's avatar
Mohamed Guirat committed
357
358
359
360
361

        }

        private void finirExp_Click(object sender, RoutedEventArgs e)
        {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
362
            saveEvent("Appui boutonFIN", "Fin", "");
Mohamed Guirat's avatar
Mohamed Guirat committed
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
            int h = 0;
            resultatFinal = new Resultat();
            resultatFinal.Code_Participant = App.codeParticipant;
            resultatFinal.momentJour = new List<MomentJour>();

            for (int p = 0; p < 3; p++)
            {
                for (int k = 0; k < 7; k++)
                {
                    resultatFinal.momentJour.Add(new MomentJour { abs = p, coord = k, listMedicaments = tabListMedicaments[h] });
                    //resultatFinal.momentJour[k].abs = p;
                    //resultatFinal.momentJour[k].coord = k;
                    //resultatFinal.momentJour[k].listMedicaments = tabListMedicaments[h];
                    h++;
                }

            }

            ExpPrescResulat = new ExperiencePrescResult();
            ExpPrescResulat.experimentateur = App.experimentateur;
            ExpPrescResulat.date = App.date;
            ExpPrescResulat.Code_Participant = App.codeParticipant;
            ExpPrescResulat.type = App.type;
            ExpPrescResulat.utilisation = App.utilisation;
            ExpPrescResulat.pilulier = App.pilulier;
            ExpPrescResulat.format = App.format;
            ExpPrescResulat.mode = App.mode;
            ExpPrescResulat.navigation = App.navigation;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
391
            ExpPrescResulat.etapes = listEtapes;
Mohamed Guirat's avatar
Mohamed Guirat committed
392
393
394
395
            ExpPrescResulat.prescription = App.prescriptionTabSelect;
            ExpPrescResulat.Resultat = resultatFinal;

            ListExpPrescResulat.Add(ExpPrescResulat);
Mohamed Guirat's avatar
Mohamed Guirat committed
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
            File.WriteAllText(sampleFileExp, JsonConvert.SerializeObject(ListExpPrescResulat));

            ListExpConf = new List<ExperienceConf>();
            if (ListExperiencesConfTmp != null)
            {
                ListExpConf = ListExperiencesConfTmp;
            }
            i = 0;
            foreach (Medicament medicament in prescriptionTmp.medicaments)
            {
                medicament.nbr = nbrPilules[i] ;
                i++;
            }
            ListExpConf.Add(new ExperienceConf { dateTime = DateTime.Today.Date,id = indexExp, listeConsigne = App.consignesSelect,codeParticipant = App.codeParticipant,prescription= prescriptionTmp , prescriptionTab=App.prescriptionTabSelect });
            File.WriteAllText(sampleFileExperienceConf, JsonConvert.SerializeObject(ListExpConf));

           // fichier Excel


Mohamed Guirat's avatar
Mohamed Guirat committed
415
416

            feedbackMsg.Text = "L'expérience '" + App.codeParticipant + "' a bien été enregistrée ";
Mohamed Guirat's avatar
Mohamed Guirat committed
417
418
            if (!feedback.IsOpen) feedback.IsOpen = true;
            //show(feedback);
Mohamed Guirat's avatar
Mohamed Guirat committed
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438


        }
        public void show(Popup popup)
        {

            popup.IsOpen = true;

            DispatcherTimer timer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(2)
            };

            timer.Tick += delegate (object sender, EventArgs e)
            {
                ((DispatcherTimer)timer).Stop();
                if (popup.IsOpen) popup.IsOpen = false;
            };

            timer.Start();
Mohamed Guirat's avatar
Mohamed Guirat committed
439
            
Mohamed Guirat's avatar
Mohamed Guirat committed
440
441
442
443
444
445
        }

        private void delete_Click(object sender, RoutedEventArgs e)
        {
            if (medicamentSelect != null)
            {
Mohamed Guirat's avatar
Mohamed Guirat committed
446
447
448
                gridViewTabMedicament[IndexgridviewSelect].ItemsSource = null;
                gridViewTabMedicament[IndexgridviewSelect].ItemsSource = tabListMedicaments[IndexgridviewSelect];
                if (open[IndexgridviewSelect] == true && tabListMedicaments[IndexgridviewSelect][indexMediSelect].nbrTab > 0)
Mohamed Guirat's avatar
Mohamed Guirat committed
449
                {
Mohamed Guirat's avatar
Mohamed Guirat committed
450
                    
Mohamed Guirat's avatar
Mohamed Guirat committed
451
                    tabListMedicaments[IndexgridviewSelect][indexMediSelect].nbrTab--;
Mohamed Guirat's avatar
Mohamed Guirat committed
452
453
454
455
                    if(tabListMedicaments[IndexgridviewSelect][indexMediSelect].nbrTab == 0)
                    {
                        tabListMedicaments[IndexgridviewSelect].Remove(tabListMedicaments[IndexgridviewSelect][indexMediSelect]);
                    }
Mohamed Guirat's avatar
Mohamed Guirat committed
456
457
                    gridViewTabMedicament[IndexgridviewSelect].ItemsSource = null;
                    gridViewTabMedicament[IndexgridviewSelect].ItemsSource = tabListMedicaments[IndexgridviewSelect];
Mohamed Guirat's avatar
Mohamed Guirat committed
458
                    //listMedicament[j].nbr--;
Mohamed Guirat's avatar
Mohamed Guirat committed
459
460
461
462
463
464
465
466
467

                    for (int l = 0; l < listMedicament.Count; l++)
                    {
                        if (listMedicament[l].nom == medicamentSelect.nom)
                        {
                            listMedicament[l].nbr++;
                            break;
                        }
                    }
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
468
                    saveEvent("Appui CORBEILLE", "Suppression du médicament "+ medicamentSelect.nom, "");
Mohamed Guirat's avatar
Mohamed Guirat committed
469
470
471
472
473
474
475

                    gridViewBoiteMedicaments.ItemsSource = null;
                    gridViewBoiteMedicaments.ItemsSource = listMedicament;
                    
                }
                medicamentSelect = null;
            }
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
476
477
478
            else
                saveEvent("Appui CORBEILLE", "pas d’événement", "");

Mohamed Guirat's avatar
Mohamed Guirat committed
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
            gridViewBoiteMedicaments.ItemsSource = null;
            gridViewBoiteMedicaments.ItemsSource = listMedicament;
        }

      
      
        //private void gridViewBoiteMedicaments_MouseDown(object sender, MouseButtonEventArgs e)
        //{
        //    medicamentChoisi = (Medicament)gridViewBoiteMedicaments.SelectedItem;
        //    j = gridViewBoiteMedicaments.SelectedIndex;

        //}
        private void gridViewBoiteMedicaments_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            medicamentChoisi = (Medicament)gridViewBoiteMedicaments.SelectedItem;
            j = gridViewBoiteMedicaments.SelectedIndex;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
495
496
            saveEvent("Appui Boite-"+ medicamentChoisi.nom, "Sélection1 UNITE-" + medicamentChoisi.nom, "");

Mohamed Guirat's avatar
Mohamed Guirat committed
497
498
            medicamentSelect = null;
        }
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
499
        private void ExecSingleTap(int i, ListView gridviewTab, String codeAlveole)
Mohamed Guirat's avatar
Mohamed Guirat committed
500
501
502
503
        {
            nvMedicament = true;
            if (open[i] == true && listMedicament[j].nbr > 0 && medicamentChoisi != null)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
504
                //System.Diagnostics.Debug.WriteLine(tabListMedicaments[i].Count);
Mohamed Guirat's avatar
Mohamed Guirat committed
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
                //if there is this medecines
                for (int k = 0; k < tabListMedicaments[i].Count; k++)
                {
                    if (tabListMedicaments[i][k].nom == medicamentChoisi.nom)
                    {
                        tabListMedicaments[i][k].nbrTab++;
                        //medicamentChoisi.nbrTab = 0;
                        nvMedicament = false;
                        break;
                    }
                }
                if (nvMedicament)
                {
                    medicamentChoisi.nbrTab = 1;
                    tabListMedicaments[i].Add(medicamentChoisi);
                }
                listMedicament[j].nbr--;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
522
523
                saveEvent("Appui ALVEOLE-" + codeAlveole, "Dépôt"+ medicamentChoisi.nbrTab+" UNITE -" + medicamentChoisi.nom, "");
                
Mohamed Guirat's avatar
Mohamed Guirat committed
524
525
526
527
528
529
530
531
532
533
                gridViewBoiteMedicaments.ItemsSource = null;
                gridViewBoiteMedicaments.ItemsSource = listMedicament;

                gridviewTab.ItemsSource = null;
                gridviewTab.ItemsSource = tabListMedicaments[i];

                medicamentChoisi = null;
            }
            else if (listMedicament[j].nbr <= 0)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
534
                saveEvent("Appui ALVEOLE-"+ codeAlveole, "pas d'évennement, la boite du médicament est vide ", "");
Mohamed Guirat's avatar
Mohamed Guirat committed
535
536
537
538
539
540
541
542
                //MessageDialog boiteVide = new MessageDialog("La boite de " + listMedicament[j].nom + " est vide");
                //boiteVide.ShowAsync();
            }
            else if (medicamentChoisi == null)
            {
                //MessageDialog selesctMedi = new MessageDialog("choisissez un médicament svp");
                //selesctMedi.ShowAsync();
            }
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
543
544
545
            else
                saveEvent("Appui ALVEOLE-" + codeAlveole, "pas d'évennement, l'alveole-"+ codeAlveole+" est fermée", "");

Mohamed Guirat's avatar
Mohamed Guirat committed
546
        }
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
547
        private void ExecDoubleTap(int i, ListView gridviewTab, String codeAlveole)
Mohamed Guirat's avatar
Mohamed Guirat committed
548
549
550
551
552
553
554
555
        {
            if (!open[i])
            {
                if (openCase == "")
                {
                    open[i] = true;
                    openCase = gridviewTab.Name;
                    gridviewTab.Background = new SolidColorBrush(Colors.White);
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
556
557
                    saveEvent("Appui ALVEOLE-"+ codeAlveole, "Ouverture ALVEOLE-"+codeAlveole, "");

Mohamed Guirat's avatar
Mohamed Guirat committed
558
559
560
561
562
563
564
565
566
567
568
569
                }
                else
                {
                    //MessageDialog autreCaseOuverte = new MessageDialog("fermer l'autre case ouverte d'abord");
                    //autreCaseOuverte.ShowAsync();
                }
            }
            else
            {
                open[i] = false;
                openCase = "";
                gridviewTab.Background = new SolidColorBrush(Colors.WhiteSmoke);
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
570
                saveEvent("Appui ALVEOLE-"+ codeAlveole, "Fermeture ALVEOLE-"+ codeAlveole, "");
Mohamed Guirat's avatar
Mohamed Guirat committed
571
572
573
574
            }

         
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
575
        private void gridViewTabMedicament11Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
576
577
578
579
580
581
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
582
                    ExecSingleTap(0, gridViewTabMedicament11, "M1J1");
Mohamed Guirat's avatar
Mohamed Guirat committed
583
584
585
586
587
588
                    if(gridViewTabMedicament11.SelectedItem !=null )
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 0;
                        medicamentSelect = (Medicament)gridViewTabMedicament11.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
589
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
590
591
592
593
594
595
596
                        indexMediSelect = gridViewTabMedicament11.Items.IndexOf(gridViewTabMedicament11.SelectedItem);
                    }
                   
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
597
                    ExecDoubleTap(0, gridViewTabMedicament11, "M1J1");
Mohamed Guirat's avatar
Mohamed Guirat committed
598
599
600
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
601
        private void gridViewTabMedicament12Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
602
603
604
605
606
607
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
608
                    ExecSingleTap(1, gridViewTabMedicament12, "M1J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
609
610
611
612
613
614
                    if (gridViewTabMedicament12.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 1;
                        medicamentSelect = (Medicament)gridViewTabMedicament12.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
615
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
616
617
618
619
620
621
                        indexMediSelect = gridViewTabMedicament12.Items.IndexOf(gridViewTabMedicament12.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
622
                    ExecDoubleTap(1, gridViewTabMedicament12, "M1J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
623
624
625
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
626
        private void gridViewTabMedicament13Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
627
628
629
630
631
632
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
633
                    ExecSingleTap(2, gridViewTabMedicament13, "M1J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
634
635
636
637
638
639
                    if (gridViewTabMedicament13.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 2;
                        medicamentSelect = (Medicament)gridViewTabMedicament13.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
640
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
641
642
643
644
645
646
                        indexMediSelect = gridViewTabMedicament13.Items.IndexOf(gridViewTabMedicament13.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
647
                    ExecDoubleTap(2, gridViewTabMedicament13, "M1J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
648
649
650
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
651
        private void gridViewTabMedicament14Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
652
653
654
655
656
657
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
658
                    ExecSingleTap(3, gridViewTabMedicament14, "M1J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
659
660
661
662
663
664
                    if (gridViewTabMedicament14.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 3;
                        medicamentSelect = (Medicament)gridViewTabMedicament14.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
665
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
666
667
668
669
670
671
                        indexMediSelect = gridViewTabMedicament14.Items.IndexOf(gridViewTabMedicament14.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
672
                    ExecDoubleTap(3, gridViewTabMedicament14, "M1J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
673
674
675
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
676
        private void gridViewTabMedicament15Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
677
678
679
680
681
682
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
683
                    ExecSingleTap(4, gridViewTabMedicament15, "M1J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
684
685
686
687
688
689
                    if (gridViewTabMedicament15.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 4;
                        medicamentSelect = (Medicament)gridViewTabMedicament15.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
690
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
691
692
693
694
695
696
                        indexMediSelect = gridViewTabMedicament15.Items.IndexOf(gridViewTabMedicament15.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
697
                    ExecDoubleTap(4, gridViewTabMedicament15, "M1J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
698
699
700
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
701
        private void gridViewTabMedicament16Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
702
703
704
705
706
707
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
708
                    ExecSingleTap(5, gridViewTabMedicament16, "M1J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
709
710
711
712
713
714
                    if (gridViewTabMedicament16.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 5;
                        medicamentSelect = (Medicament)gridViewTabMedicament16.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
715
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
716
717
718
719
720
721
                        indexMediSelect = gridViewTabMedicament16.Items.IndexOf(gridViewTabMedicament16.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
722
                    ExecDoubleTap(5, gridViewTabMedicament16, "M1J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
723
724
725
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
726
        private void gridViewTabMedicament17Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
727
728
729
730
731
732
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
733
                    ExecSingleTap(6, gridViewTabMedicament17, "M1J7");
Mohamed Guirat's avatar
Mohamed Guirat committed
734
735
736
737
738
739
                    if (gridViewTabMedicament17.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 6;
                        medicamentSelect = (Medicament)gridViewTabMedicament17.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
740
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
741
742
743
744
745
746
                        indexMediSelect = gridViewTabMedicament17.Items.IndexOf(gridViewTabMedicament17.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
747
                    ExecDoubleTap(6, gridViewTabMedicament17, "M1J7");
Mohamed Guirat's avatar
Mohamed Guirat committed
748
749
750
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
751
        private void gridViewTabMedicament21Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
752
753
754
755
756
757
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
758
                    ExecSingleTap(7, gridViewTabMedicament21, "M2J1");
Mohamed Guirat's avatar
Mohamed Guirat committed
759
760
761
762
763
764
                    if (gridViewTabMedicament21.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 7;
                        medicamentSelect = (Medicament)gridViewTabMedicament21.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
765
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
766
767
768
769
770
771
                        indexMediSelect = gridViewTabMedicament21.Items.IndexOf(gridViewTabMedicament21.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
772
                    ExecDoubleTap(7, gridViewTabMedicament21, "M2J1");
Mohamed Guirat's avatar
Mohamed Guirat committed
773
774
775
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
776
        private void gridViewTabMedicament22Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
777
778
779
780
781
782
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
783
                    ExecSingleTap(8, gridViewTabMedicament22, "M2J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
784
785
786
787
788
789
                    if (gridViewTabMedicament22.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 8;
                        medicamentSelect = (Medicament)gridViewTabMedicament22.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
790
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
791
792
793
794
795
796
                        indexMediSelect = gridViewTabMedicament22.Items.IndexOf(gridViewTabMedicament22.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
797
                    ExecDoubleTap(8, gridViewTabMedicament22, "M2J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
798
799
800
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
801
        private void gridViewTabMedicament23Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
802
803
804
805
806
807
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
808
                    ExecSingleTap(9, gridViewTabMedicament23, "M2J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
809
810
811
812
813
814
                    if (gridViewTabMedicament23.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 9;
                        medicamentSelect = (Medicament)gridViewTabMedicament23.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
815
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
816
817
818
819
820
821
                        indexMediSelect = gridViewTabMedicament23.Items.IndexOf(gridViewTabMedicament23.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
822
                    ExecDoubleTap(9, gridViewTabMedicament23, "M2J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
823
824
825
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
826
        private void gridViewTabMedicament24Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
827
828
829
830
831
832
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
833
                    ExecSingleTap(10, gridViewTabMedicament24, "M2J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
834
835
836
837
838
839
                    if (gridViewTabMedicament24.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 10;
                        medicamentSelect = (Medicament)gridViewTabMedicament24.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
840
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
841
842
843
844
845
846
                        indexMediSelect = gridViewTabMedicament24.Items.IndexOf(gridViewTabMedicament24.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
847
                    ExecDoubleTap(10, gridViewTabMedicament24, "M2J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
848
849
850
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
851
        private void gridViewTabMedicament25Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
852
853
854
855
856
857
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
858
                    ExecSingleTap(11, gridViewTabMedicament25, "M2J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
859
860
861
862
863
864
                    if (gridViewTabMedicament25.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 11;
                        medicamentSelect = (Medicament)gridViewTabMedicament25.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
865
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
866
867
868
869
870
871
                        indexMediSelect = gridViewTabMedicament25.Items.IndexOf(gridViewTabMedicament25.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
872
                    ExecDoubleTap(11, gridViewTabMedicament25, "M2J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
873
874
875
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
876
        private void gridViewTabMedicament26Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
877
878
879
880
881
882
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
883
                    ExecSingleTap(12, gridViewTabMedicament26, "M2J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
884
885
886
887
888
889
                    if (gridViewTabMedicament26.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 12;
                        medicamentSelect = (Medicament)gridViewTabMedicament26.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
890
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
891
892
893
894
895
896
                        indexMediSelect = gridViewTabMedicament26.Items.IndexOf(gridViewTabMedicament26.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
897
                    ExecDoubleTap(12, gridViewTabMedicament26, "M2J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
898
899
900
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
901
        private void gridViewTabMedicament27Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
902
903
904
905
906
907
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
908
                    ExecSingleTap(13, gridViewTabMedicament27, "M2J7");
Mohamed Guirat's avatar
Mohamed Guirat committed
909
910
911
912
913
914
                    if (gridViewTabMedicament27.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 13;
                        medicamentSelect = (Medicament)gridViewTabMedicament27.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
915
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
916
917
918
919
920
921
                        indexMediSelect = gridViewTabMedicament27.Items.IndexOf(gridViewTabMedicament27.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
922
                    ExecDoubleTap(13, gridViewTabMedicament27, "M2J7");
Mohamed Guirat's avatar
Mohamed Guirat committed
923
924
925
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
926
        private void gridViewTabMedicament31Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
927
928
929
930
931
932
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
933
                    ExecSingleTap(14, gridViewTabMedicament31, "M3J1");
Mohamed Guirat's avatar
Mohamed Guirat committed
934
935
936
937
938
939
                    if (gridViewTabMedicament31.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 14;
                        medicamentSelect = (Medicament)gridViewTabMedicament31.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
940
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
941
942
943
944
945
946
                        indexMediSelect = gridViewTabMedicament31.Items.IndexOf(gridViewTabMedicament31.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
947
                    ExecDoubleTap(14, gridViewTabMedicament31, "M3J1");
Mohamed Guirat's avatar
Mohamed Guirat committed
948
949
950
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
951
        private void gridViewTabMedicament32Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
952
953
954
955
956
957
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
958
                    ExecSingleTap(15, gridViewTabMedicament32, "M3J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
959
960
961
962
963
964
                    if (gridViewTabMedicament32.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 15;
                        medicamentSelect = (Medicament)gridViewTabMedicament32.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
965
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
966
967
968
969
970
971
                        indexMediSelect = gridViewTabMedicament32.Items.IndexOf(gridViewTabMedicament32.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
972
                    ExecDoubleTap(15, gridViewTabMedicament32, "M3J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
973
974
975
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
976
        private void gridViewTabMedicament33Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
977
978
979
980
981
982
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
983
                    ExecSingleTap(16, gridViewTabMedicament33, "M3J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
984
985
986
987
988
989
                    if (gridViewTabMedicament33.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 16;
                        medicamentSelect = (Medicament)gridViewTabMedicament33.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
990
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
991
992
993
994
995
996
                        indexMediSelect = gridViewTabMedicament33.Items.IndexOf(gridViewTabMedicament33.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
997
                    ExecDoubleTap(16, gridViewTabMedicament33, "M3J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
998
999
1000
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
1001
        private void gridViewTabMedicament34Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
1002
1003
1004
1005
1006
1007
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1008
                    ExecSingleTap(17, gridViewTabMedicament34, "M3J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
1009
1010
1011
1012
1013
1014
                    if (gridViewTabMedicament34.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 17;
                        medicamentSelect = (Medicament)gridViewTabMedicament34.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1015
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
1016
1017
1018
1019
1020
1021
                        indexMediSelect = gridViewTabMedicament34.Items.IndexOf(gridViewTabMedicament34.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1022
                    ExecDoubleTap(17, gridViewTabMedicament34, "M3J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
1023
1024
1025
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
1026
        private void gridViewTabMedicament35Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
1027
1028
1029
1030
1031
1032
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1033
                    ExecSingleTap(18, gridViewTabMedicament35, "M3J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
1034
1035
1036
1037
1038
1039
                    if (gridViewTabMedicament35.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 18;
                        medicamentSelect = (Medicament)gridViewTabMedicament35.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1040
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
1041
1042
1043
1044
1045
1046
                        indexMediSelect = gridViewTabMedicament35.Items.IndexOf(gridViewTabMedicament35.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1047
                    ExecDoubleTap(18, gridViewTabMedicament35, "M3J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
1048
1049
1050
                }
            }
        }
Mohamed Guirat's avatar
Mohamed Guirat committed
1051
        private void gridViewTabMedicament36Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
1052
1053
1054
1055
1056
1057
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1058
                    ExecSingleTap(19, gridViewTabMedicament36, "M3J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
1059
1060
1061
1062
1063
1064
                    if (gridViewTabMedicament36.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 19;
                        medicamentSelect = (Medicament)gridViewTabMedicament36.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1065
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
1066
1067
1068
1069
1070
1071
                        indexMediSelect = gridViewTabMedicament36.Items.IndexOf(gridViewTabMedicament36.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1072
                    ExecDoubleTap(19, gridViewTabMedicament36, "M3J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
1073
1074
1075
1076
1077
1078
                }
            }
        }

       

Mohamed Guirat's avatar
Mohamed Guirat committed
1079
        private void gridViewTabMedicament37Item_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
Mohamed Guirat's avatar
Mohamed Guirat committed
1080
1081
1082
1083
1084
1085
        {
            var item = sender as ListViewItem;
            if (item != null)
            {
                if (e.ClickCount == 1)
                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1086
                    ExecSingleTap(20, gridViewTabMedicament37, "M3J17");
Mohamed Guirat's avatar
Mohamed Guirat committed
1087
1088
1089
1090
1091
1092
                    if (gridViewTabMedicament37.SelectedItem != null)
                    {
                        mediSelected = true;
                        //System.Diagnostics.Debug.WriteLine((Medicament)gridViewTabMedicament11.SelectedItem);
                        IndexgridviewSelect = 20;
                        medicamentSelect = (Medicament)gridViewTabMedicament37.SelectedItem;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1093
                        //System.Diagnostics.Debug.WriteLine(medicamentSelect.nom);
Mohamed Guirat's avatar
Mohamed Guirat committed
1094
1095
1096
1097
1098
1099
                        indexMediSelect = gridViewTabMedicament37.Items.IndexOf(gridViewTabMedicament37.SelectedItem);
                    }
                }
                else

                {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1100
                    ExecDoubleTap(20, gridViewTabMedicament37, "M3J17");
Mohamed Guirat's avatar
Mohamed Guirat committed
1101
1102
1103
1104
1105
1106
1107
1108
                }
            }
        }

        private void gridViewTabMedicament11_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1109
1110
                ExecSingleTap(0, gridViewTabMedicament11, "M1J1");

Mohamed Guirat's avatar
Mohamed Guirat committed
1111
1112
1113
1114
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1115
                ExecDoubleTap(0, gridViewTabMedicament11, "M1J1");
Mohamed Guirat's avatar
Mohamed Guirat committed
1116
1117
1118
1119
1120
1121
1122
            }
        }

        private void gridViewTabMedicament12_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1123
                ExecSingleTap(1, gridViewTabMedicament12, "M1J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
1124
1125
1126
1127
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1128
                ExecDoubleTap(1, gridViewTabMedicament12, "M1J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
1129
1130
1131
1132
1133
1134
            }
        }
        private void gridViewTabMedicament13_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1135
                ExecSingleTap(2, gridViewTabMedicament13, "M1J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
1136
1137
1138
1139
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1140
                ExecDoubleTap(2, gridViewTabMedicament13, "M1J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
1141
1142
1143
1144
1145
1146
1147
            }
        }

        private void gridViewTabMedicament14_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1148
                ExecSingleTap(3, gridViewTabMedicament14, "M1J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
1149
1150
1151
1152
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1153
                ExecDoubleTap(3, gridViewTabMedicament14, "M1J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
1154
1155
1156
1157
1158
1159
1160
            }
        }

        private void gridViewTabMedicament15_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1161
                ExecSingleTap(4, gridViewTabMedicament15, "M1J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
1162
1163
1164
1165
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1166
                ExecDoubleTap(4, gridViewTabMedicament15, "M1J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
1167
1168
1169
1170
1171
1172
1173
            }
        }

        private void gridViewTabMedicament16_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1174
                ExecSingleTap(5, gridViewTabMedicament16, "M1J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
1175
1176
1177
1178
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1179
                ExecDoubleTap(5, gridViewTabMedicament16, "M1J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
1180
1181
1182
1183
1184
1185
1186
            }
        }

        private void gridViewTabMedicament17_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1187
                ExecSingleTap(6, gridViewTabMedicament17, "M1J7");
Mohamed Guirat's avatar
Mohamed Guirat committed
1188
1189
1190
1191
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1192
                ExecDoubleTap(6, gridViewTabMedicament17, "M1J7");
Mohamed Guirat's avatar
Mohamed Guirat committed
1193
1194
1195
1196
1197
1198
1199
            }
        }

        private void gridViewTabMedicament21_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1200
                ExecSingleTap(7, gridViewTabMedicament21, "M2J1");
Mohamed Guirat's avatar
Mohamed Guirat committed
1201
1202
1203
1204
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1205
                ExecDoubleTap(7, gridViewTabMedicament21, "M2J1");
Mohamed Guirat's avatar
Mohamed Guirat committed
1206
1207
1208
1209
1210
1211
1212
            }
        }

        private void gridViewTabMedicament22_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1213
                ExecSingleTap(8, gridViewTabMedicament22, "M2J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
1214
1215
1216
1217
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1218
                ExecDoubleTap(8, gridViewTabMedicament22, "M2J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
1219
1220
1221
1222
1223
1224
1225
            }
        }

        private void gridViewTabMedicament23_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1226
                ExecSingleTap(9, gridViewTabMedicament23, "M2J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
1227
1228
1229
1230
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1231
                ExecDoubleTap(9, gridViewTabMedicament23, "M2J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
1232
1233
1234
1235
1236
1237
1238
            }
        }

        private void gridViewTabMedicament24_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1239
                ExecSingleTap(10, gridViewTabMedicament24, "M2J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
1240
1241
1242
1243
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1244
                ExecDoubleTap(10, gridViewTabMedicament24, "M2J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
1245
1246
1247
1248
1249
1250
1251
            }
        }

        private void gridViewTabMedicament25_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1252
                ExecSingleTap(11, gridViewTabMedicament25, "M2J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
1253
1254
1255
1256
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1257
                ExecDoubleTap(11, gridViewTabMedicament25, "M2J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
1258
1259
1260
1261
1262
1263
1264
            }
        }

        private void gridViewTabMedicament26_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1265
                ExecSingleTap(12, gridViewTabMedicament26, "M2J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
1266
1267
1268
1269
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1270
                ExecDoubleTap(12, gridViewTabMedicament26, "M2J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
1271
1272
1273
1274
1275
1276
1277
            }
        }

        private void gridViewTabMedicament27_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1278
                ExecSingleTap(13, gridViewTabMedicament27, "M2J7");
Mohamed Guirat's avatar
Mohamed Guirat committed
1279
1280
1281
1282
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1283
                ExecDoubleTap(13, gridViewTabMedicament27, "M2J7");
Mohamed Guirat's avatar
Mohamed Guirat committed
1284
1285
1286
1287
1288
1289
1290
            }
        }

        private void gridViewTabMedicament31_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1291
                ExecSingleTap(14, gridViewTabMedicament31, "M3J1");
Mohamed Guirat's avatar
Mohamed Guirat committed
1292
1293
1294
1295
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1296
                ExecDoubleTap(14, gridViewTabMedicament31, "M3J1");
Mohamed Guirat's avatar
Mohamed Guirat committed
1297
1298
1299
1300
1301
1302
1303
            }
        }

        private void gridViewTabMedicament32_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1304
                ExecSingleTap(15, gridViewTabMedicament32, "M3J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
1305
1306
1307
1308
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1309
                ExecDoubleTap(15, gridViewTabMedicament32, "M3J2");
Mohamed Guirat's avatar
Mohamed Guirat committed
1310
1311
1312
1313
1314
1315
1316
            }
        }

        private void gridViewTabMedicament33_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1317
                ExecSingleTap(16, gridViewTabMedicament33, "M3J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
1318
1319
1320
1321
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1322
                ExecDoubleTap(16, gridViewTabMedicament33, "M3J3");
Mohamed Guirat's avatar
Mohamed Guirat committed
1323
1324
1325
            }
        }

Mohamed Guirat's avatar
Mohamed Guirat committed
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338


        private void RetournerAcceuil_Click(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Navigate(new Uri("pages/MainPage.xaml", UriKind.Relative));

        }

        private void PilulierBtn_Click(object sender, RoutedEventArgs e)
        {
            
            PrescriptonAffichage.Visibility = Visibility.Collapsed;
            PilulierPanel.Visibility = Visibility.Visible;
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1339
            saveEvent("AppuiButtonPilulier", "Affichage"+ nbrAffPil + "Pilulier","");
Mohamed Guirat's avatar
Mohamed Guirat committed
1340
1341
1342
            nbrAffPil++;
        }

Mohamed Guirat's avatar
Mohamed Guirat committed
1343
1344
1345
1346
        private void gridViewTabMedicament34_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1347
                ExecSingleTap(17, gridViewTabMedicament34, "M3J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
1348
1349
1350
1351
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1352
                ExecDoubleTap(17, gridViewTabMedicament34, "M3J4");
Mohamed Guirat's avatar
Mohamed Guirat committed
1353
1354
1355
1356
1357
1358
1359
            }
        }

        private void gridViewTabMedicament35_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1360
                ExecSingleTap(18, gridViewTabMedicament35, "M3J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
1361
1362
1363
1364
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1365
                ExecDoubleTap(18, gridViewTabMedicament35, "M3J5");
Mohamed Guirat's avatar
Mohamed Guirat committed
1366
1367
1368
1369
1370
1371
1372
            }
        }

        private void gridViewTabMedicament36_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1373
                ExecSingleTap(19, gridViewTabMedicament36, "M3J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
1374
1375
1376
1377
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1378
                ExecDoubleTap(19, gridViewTabMedicament36, "M3J6");
Mohamed Guirat's avatar
Mohamed Guirat committed
1379
1380
1381
1382
1383
1384
1385
            }
        }

        private void gridViewTabMedicament37_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 1)
            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1386
                ExecSingleTap(20, gridViewTabMedicament37, "M3J7");
Mohamed Guirat's avatar
Mohamed Guirat committed
1387
1388
1389
1390
            }
            else

            {
Mohamed Guirat's avatar
events    
Mohamed Guirat committed
1391
                ExecDoubleTap(20, gridViewTabMedicament37, "M3J7");
Mohamed Guirat's avatar
Mohamed Guirat committed
1392
1393
1394
1395
1396
1397
1398
1399
            }
        }

        


    }
}