Esempio n. 1
0
        public static IEnumerable <StationItem> GetItems(StationCategory StationCategory = StationCategory.All)
        {
            var list = new List <StationItem>();

            _ids.Where(kvp => (kvp.Key & StationCategory) != 0).Select(kvp => kvp.Value).ForEach(a => list.AddRange(a));
            return(list);
        }
Esempio n. 2
0
        public static long[] GetConvertedIds(StationCategory StationCategory = StationCategory.All)
        {
            var list = new List <long>();

            Ids.Where(kvp => IsCategoryEnabled(kvp.Key) && (kvp.Key & StationCategory) != 0).Select(kvp => kvp.Value).ForEach(l => l.ForEach(t =>
            {
                if (!t.Exclude)
                {
                    list.Add(t.WorkshopId);
                }
            }));
            return(list.ToArray());
        }
Esempio n. 3
0
        private static bool IsCategoryEnabled(StationCategory StationCategory)
        {
            switch (StationCategory)
            {
            case StationCategory.Modern:
                return(OptionsWrapper <Options> .Options.ConvertModernStationsToMetroStations);

            case StationCategory.Old:
                return(OptionsWrapper <Options> .Options.ConvertOldStationsToMetroStations);

            case StationCategory.Tram:
                return(OptionsWrapper <Options> .Options.ConvertTramStationsToMetroStations);

            default:
                throw new ArgumentOutOfRangeException(nameof(StationCategory), StationCategory, null);
            }
        }
Esempio n. 4
0
        private void CmbStation_SelectedIndexChanged(object sender, EventArgs e)
        {
            StationCategory sc          = (StationCategory)Enum.Parse(typeof(StationCategory), cmbStation.Text);
            List <string>   lTesterIDs  = new List <string>();
            string          dbTableName = string.Empty;

            clbTester.Items.Clear();
            switch (sc)
            {
            case StationCategory.FCT:
                dbTableName = cmbProject.Text + "_FCT";
                break;

            case StationCategory.SFG:
                dbTableName = cmbProject.Text + "_SFG";
                break;

            case StationCategory.FG00:
                dbTableName = cmbProject.Text + "_FG00";
                break;

            case StationCategory.FG24:
                dbTableName = cmbProject.Text + "_FG24";
                break;

            default:
                break;
            }

            lTesterIDs = DB_Jagwar.GetTesterIDs(dbTableName);
            foreach (var v in FATPTesterMap)
            {
                foreach (string id in v.Value)
                {
                    if (lTesterIDs.Contains(id))
                    {
                        clbTester.Items.Add(v.Key + "-" + id);
                    }
                }
            }
        }