Пример #1
0
 private void ProcessMCOLine(string line)
 {
     try
     {
         List <string> list = new List <string>();
         foreach (Match match in csvSplit.Matches(line))
         {
             list.Add(match.Value.TrimStart(',').Replace("\"", ""));
         }
         MCOData mco = new MCOData(list.ToArray());
         mco.Ticket     = LookupData.First(p => p.NoFiche == mco.NoFiche);
         mco.Traitement = SuiviData.FirstOrDefault(p => p.NoFiche == mco.NoFiche) ?? new SuiviData();
         MCOData.Add(mco);
     }
     catch (Exception) { }
 }
Пример #2
0
        public ObservableCollection <MCOData> ApplyMCOFilter(int colIndex, ObservableCollection <FilterModel> filterValues)
        {
            // reset list
            MCOData = AllMCOData;
            // update or create cache with user selection for next time col is filtered
            if (activeFilters.ContainsKey(colIndex))
            {
                activeFilters[colIndex] = filterValues;
            }
            else
            {
                activeFilters.Add(colIndex, filterValues);
            }

            foreach (int i in activeFilters.Keys)
            {
                ObservableCollection <FilterModel> columnFilter = activeFilters[i];
                switch (i)
                {
                case 0:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.NoFiche && x.Checked)));
                    break;

                case 1:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Priorite && x.Checked)));
                    break;

                case 2:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Ticket.Gravite && x.Checked)));
                    break;

                case 3:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Statut && x.Checked)));
                    break;

                case 4:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Libelle && x.Checked)));
                    break;

                case 5:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Ticket.DateCreation.HasValue ? p.Ticket.DateCreation.Value.ToString("yyyy-MM-dd") : "") && x.Checked)));
                    break;

                case 6:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Ticket.CreateurDeLaFiche && x.Checked)));
                    break;

                case 7:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Ticket.Diagnostiqueur && x.Checked)));
                    break;

                case 8:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Ticket.Correcteur && x.Checked)));
                    break;

                case 9:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Ticket.Site && x.Checked)));
                    break;

                case 10:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Traitement.Responsable && x.Checked)));
                    break;

                case 11:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Traitement.Analyse.HasValue ? p.Traitement.Analyse.Value.ToString("yyyy-MM-dd") : "") && x.Checked)));
                    break;

                case 12:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Traitement.AnalyseFin.HasValue ? p.Traitement.AnalyseFin.Value.ToString("yyyy-MM-dd") : "") && x.Checked)));
                    break;

                case 13:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Traitement.Dev.HasValue ? p.Traitement.Dev.Value.ToString("yyyy-MM-dd") : "") && x.Checked)));
                    break;

                case 14:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Traitement.DevFin.HasValue ? p.Traitement.DevFin.Value.ToString("yyyy-MM-dd") : "") && x.Checked)));
                    break;

                case 15:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Traitement.Recette.HasValue ? p.Traitement.Recette.Value.ToString("yyyy-MM-dd") : "") && x.Checked)));
                    break;

                case 16:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Traitement.RecetteFin.HasValue ? p.Traitement.RecetteFin.Value.ToString("yyyy-MM-dd") : "") && x.Checked)));
                    break;

                case 17:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Traitement.Prod.HasValue ? p.Traitement.Prod.Value.ToString("yyyy-MM-dd") : "") && x.Checked)));
                    break;

                case 18:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.BlocsAplicatifsACorriger && x.Checked)));
                    break;

                case 19:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.NatureDeLaMaintenance && x.Checked)));
                    break;

                case 20:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.NatureDeLaFiche && x.Checked)));
                    break;

                case 21:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Version && x.Checked)));
                    break;

                case 22:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Niveu0 && x.Checked)));
                    break;

                case 23:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Niveu1 && x.Checked)));
                    break;

                case 24:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.TypeMaintenance && x.Checked)));
                    break;

                case 25:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.DirectionResponsable && x.Checked)));
                    break;

                case 26:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.SecteurDeRecette && x.Checked)));
                    break;

                case 27:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.DomaineDeDetection && x.Checked)));
                    break;

                case 28:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Ticket.DomaineCorrection && x.Checked)));
                    break;

                case 29:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Ticket.SecteurCorrection && x.Checked)));
                    break;

                case 30:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.SousSecteur && x.Checked)));
                    break;

                case 31:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == p.Gamme && x.Checked)));
                    break;

                case 32:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Ticket.ModifieLe.HasValue ? p.Ticket.ModifieLe.Value.ToString("yyyy-MM-dd") : "") && x.Checked)));
                    break;

                case 33:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Ticket.FinDeCloture.HasValue ? p.Ticket.FinDeCloture.Value.ToString("yyyy-MM-dd") : "") && x.Checked)));
                    break;

                case 34:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Ticket.DateDeDerniereAffectation.HasValue ? p.Ticket.DateDeDerniereAffectation.Value.ToString("yyyy-MM-dd") : "") && x.Checked)));
                    break;

                case 35:
                    MCOData = new ObservableCollection <MCOData>(MCOData.Where(p => columnFilter.Any(x => (x.Text != "Vides" ? x.Text : "") == (p.Traitement.Report ? "Oui" : "Non") && x.Checked)));
                    break;
                }
            }
            return(new ObservableCollection <MCOData>(MCOData));
        }
Пример #3
0
        private void dgMCO_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            MCOData model = (MCOData)dgMCO.SelectedItem;

            NotesLinkHelper.OpenNotesDocument(model.Ticket.DocumentUniqueID);
        }