Example #1
0
 private void AddStudentHome()
 {
     try
     {
         string nume;
         int    numarPersoaneInCamera, numarCamere, regie;
         IOStudentHome(out nume, out numarPersoaneInCamera, out numarCamere, out regie);
         appManager.AddStudentHome(nume, numarPersoaneInCamera, numarCamere, regie);
     }
     catch (FormatException)
     {
         Trace.WriteLine("Va rog introduceti un numar intreg!");
         AddStudentHome();
     }
     catch (OverflowException)
     {
         Trace.WriteLine("Va rog introduceti un numar mai mic!");
         AddStudentHome();
     }
     catch (ValidationException e)
     {
         Trace.WriteLine(e.Message);
         Console.WriteLine("Va rog introduceti date valide!");
         AddStudentHome();
     }
     catch (RepositoryException e)
     {
         Trace.WriteLine(e.Message);
         Console.WriteLine("Va rog introduceti date valide!");
         AddStudentHome();
     }
 }