Example #1
0
        public void AddSubmission(Submission submission)
        {
            if (CheckForPriorRegistration(submission.LastName, submission.Email, submission.Birthdate))
            {
                int serielchecker = serielNumberRepository.LookUpSerielNumber(submission.LotterySerial[0], lotteryDictionary);
                switch (serielchecker)
                {
                case 0:
                    //Seriel number do not exist
                    break;

                case 1:
                    //Seriel has already been claimed
                    break;

                case 2:
                    //Seriel is unclamied, now being claimed by this submission
                    submissionList.Add(new Submission(submission.FirstName, submission.LastName, submission.Email, submission.Phonenumber, submission.Birthdate, submission.Password, submission.LotterySerial[0]));
                    loginInformation.AddLogin(submission.Email, submission.Password, logins);
                    putDownStream.SaveSubmissionsToFile(submissionList);
                    break;

                default:
                    break;
                }
            }
        }
Example #2
0
        public int AddSubmission(Submission submission)
        {
            int serielchecker = 0;

            if (CheckForPriorRegistration(submission.LastName, submission.Email, submission.Birthdate))
            {
                serielchecker = serielNumberRepository.LookUpSerielNumber(submission.LotterySerial[0], lotteryDictionary);
                if (serielchecker == 2)
                {
                    //Seriel is unclamied, now being claimed by this submission
                    submissionList.Add(new Submission(submission.FirstName, submission.LastName, submission.Email, submission.Phonenumber, submission.Birthdate, submission.Password, submission.LotterySerial[0]));
                    loginInformation.AddLogin(submission.Email, submission.Password, logins);
                    putDownStream.SaveSubmissionsToFile(submissionList);
                    return(2);
                }
            }
            return(serielchecker);
        }