예제 #1
0
        private void AddEnrollment(int FinalTimeOfPurchase, DateTime DateTime)
        {
            string     NewEnrollment = txtMessage.Text.Replace(" ", "");
            Enrollment Enrollment    = new Enrollment(NewEnrollment.Substring(0, 3),
                                                      Int32.Parse(NewEnrollment.Substring(3, 4)));

            if (Repository.IsRepeatedEnrollment(Enrollment.LettersOfEnrollment, Enrollment.NumbersOfEnrollment))
            {
                Enrollment = Repository.GetAnEnrollment(Enrollment.LettersOfEnrollment, Enrollment.NumbersOfEnrollment);
            }
            else
            {
                Repository.AddEnrollment(Enrollment);
            }
            AddPurchase(FinalTimeOfPurchase, Enrollment, DateTime);
        }
예제 #2
0
 private void ValidateRepeatEnrollment(string Letters, string Numbers)
 {
     if (ValidatorOfEnrollment.ValidateIsNumeric(Numbers))
     {
         if (Repository.IsRepeatedEnrollment(Letters, int.Parse(Numbers)))
         {
             Enrollment EnrollmentOfPurchase = Repository.GetAnEnrollment(Letters, int.Parse(Numbers));
             ValidateDate(EnrollmentOfPurchase);
         }
         else
         {
             SetMessage("No hay ninguna compra con esa matrícula.");
         }
     }
     else
     {
         SetMessage("El formato de la matrícula no es válido.");
     }
 }
예제 #3
0
 public void ValidateGrabAnEnrollmentWithListEmpty()
 {
     Assert.AreEqual(null, Repository.GetAnEnrollment("sbn", 4040));
 }