Пример #1
0
        // Section Methods
        public List <Instrument> InstrumentSelectForSize(Selection s)
        {
            String caseSize = s.PreferredSize;

            foreach (Instrument i in instrumentRepo.GetInstrumentsBySize(caseSize))
            {
                bool add = true;
                foreach (Instrument j in sizeInstruments)
                {
                    if (i.DescriptionText.Equals(j.DescriptionText))
                    {
                        add = false;
                        break;
                    }
                }
                if (add)
                {
                    sizeInstruments.Add(i);
                }
            }

            /* // Switch
             * switch (caseSize)
             * {
             *  case "0":
             *      sizeInstrument1 = instrumentRepo.GetInstrumentsBySize("0");
             *      break;
             *  case "1":
             *      sizeInstrument1 = instrumentRepo.GetInstrumentsBySize("1");
             *      break;
             *  case "2":
             *      sizeInstrument1 = instrumentRepo.GetInstrumentsBySize("2");
             *      break;
             *  case "3":
             *      sizeInstrument1 = instrumentRepo.GetInstrumentsBySize("3");
             *      break;
             *  case "4":
             *      sizeInstrument1 = instrumentRepo.GetInstrumentsBySize("4");
             *      break;
             * }
             *
             * foreach (Instrument instrument in sizeInstrument1)
             * {
             *  bool isItThere = false;
             *  foreach (Instrument j in sizeInstruments)
             *  {
             *
             *  }
             *  if (!sizeInstruments.Contains(instrument))
             *  {
             *      sizeInstruments.Add(instrument);
             *  }
             *
             * }*/
            return(sizeInstruments);
        }