Exemple #1
0
 private Controller()
 {
     loginInformation       = new LoginInformation();
     serielNumberRepository = new SerielNumberRepository();
     putDownStream          = new FileDownStream();
     getFileUpStream        = new FileUpStream();
     serielNumberGenerator  = new SerielNumberGenerator();
     logins            = new Dictionary <string, string>();
     lotteryDictionary = new Dictionary <string, bool>();
     submissionList    = new List <Submission>();
     if (getFileUpStream.isFilePresent(0).Result)
     {
         submissionList = getFileUpStream.LoadSubmissionsFromFileAsync().Result;
     }
     if (getFileUpStream.isFilePresent(1).Result)
     {
         lotteryDictionary = serielNumberRepository.SerielNumbersFromFile().Result;
     }
     if (lotteryDictionary.IsNullOrEmpty())
     {
         Task.Run(() => lotteryDictionary = serielNumberGenerator.GenerateSerielNumberDictionary(serialsAmount));
     }
     if (getFileUpStream.isFilePresent(2).Result)
     {
         logins = loginInformation.LoadLoginsToDictinary().Result;
     }
     if (logins.IsNullOrEmpty())
     {
         logins.Add("admin", "admin");
     }
 }
Exemple #2
0
 public LotteryController()
 {
     loginInformation       = new LoginInformation();
     serielNumberRepository = new SerielNumberRepository();
     putDownStream          = new FileDownStream();
     getFileUpStream        = new FileUpStream();
     logins            = new Dictionary <string, string>();
     lotteryDictionary = new Dictionary <string, bool>();
     submissionList    = new List <Submission>();
     submissionList    = getFileUpStream.LoadSubmissionsFromFile();
     loginInformation.LoadLoginsToDictinary(logins);
     serielNumberRepository.SerielNumbersFromFile(lotteryDictionary);
 }