Ejemplo n.º 1
0
        public List <Instrument> InstrumentSelectForRange(Selection s)
        {
            string caseRange = s.PreferredRange;

            foreach (Instrument i in instrumentRepo.GetInstrumentsByRange(caseRange))
            {
                bool add = true;
                foreach (Instrument j in rangeInstruments)
                {
                    if (i.DescriptionText.Equals(j.DescriptionText))
                    {
                        add = false;
                        break;
                    }
                }
                if (add)
                {
                    rangeInstruments.Add(i);
                }
            }


            /* // Switch
             * switch (caseRange)
             * {
             *  case "0":
             *      rangeInstrument1 = instrumentRepo.GetInstrumentsByRange("0");
             *      break;
             *  case "1":
             *      rangeInstrument1 = instrumentRepo.GetInstrumentsByRange("1");
             *      break;
             *  case "2":
             *      rangeInstrument1 = instrumentRepo.GetInstrumentsByRange("2");
             *      break;
             *  case "3":
             *      rangeInstrument1 = instrumentRepo.GetInstrumentsByRange("3");
             *      break;
             *  case "4":
             *      rangeInstrument1 = instrumentRepo.GetInstrumentsByRange("4");
             *      break;
             * }
             * foreach (Instrument instrument in rangeInstrument1)
             * {
             *  if (!rangeInstruments.Contains(instrument))
             *  {
             *      rangeInstruments.Add(instrument);
             *  }
             * } */
            return(rangeInstruments);
        }