/// <summary>
        /// Recives a string list containing the serielnumbers c´recovered from a file on the file system
        /// Splits each string in the a serielnumber and a bool value, adding these as key and value in the seriel dictionary
        /// </summary>
        /// <returns>A bool</returns>
        public bool SerielNumbersFromFile(Dictionary <string, bool> lotteryDictionary)
        {
            FileUpStream  fileUpStream  = new FileUpStream();
            List <string> serielnumbers = fileUpStream.LoadSerielNumbersFromFile();

            foreach (var item in serielnumbers)
            {
                string seriel = item.Substring(0, 4);
                string value  = item.Substring(5);
                lotteryDictionary.Add(seriel, Convert.ToBoolean(value));
            }
            if (lotteryDictionary.Count > 0)
            {
                return(true);
            }
            return(false);
        }
예제 #2
0
        /// <summary>
        /// Recives a string list containing the serielnumbers recovered from a file on the file system
        /// Splits each string in the a serielnumber and a bool value, adding these as key and value in the seriel dictionary
        /// </summary>
        /// <returns>A bool</returns>
        public async Task <IDictionary <string, bool> > SerielNumbersFromFile()
        {
            IFileUpStream fileUpStream = new FileUpStream();

            return(await fileUpStream.LoadSerielNumbersFromFile());

            //IList <string> serielnumbers;
            //IDictionary<string,bool> lotteryDictionary = new Dictionary<string, bool>();
            //serielnumbers = await fileUpStream.LoadSerielNumbersFromFile();

            //foreach (var item in serielnumbers)
            //{
            //    string seriel = item.Substring(0, 4);
            //    string value = item.Substring(5);
            //    lotteryDictionary.Add(seriel, Convert.ToBoolean(value));

            //}
            //return lotteryDictionary;
        }