Example #1
0
        public static void Main()
        {
            var weekUtils = new WeekUtils("ro-RO", '-', new[]
            {
                "01.10.2018 - 21.12.2018",
                "07.01.2019 - 20.01.2019"
            });
            var taskRepository = new OnDiskTextRepository <int, Task>(
                new TaskValidator(),
                new Dictionary <int, Task>(),
                "tasks.txt");
            var studentRepository = new OnDiskTextRepository <int, Student>(
                new StudentValidator(),
                new Dictionary <int, Student>(),
                "students.txt");
            var markRepository = new OnDiskTextRepository <string, Mark>(
                new MarkValidator(),
                new Dictionary <string, Mark>(),
                "marks.txt");
            var ui = new MainTui(
                new TaskService(weekUtils, taskRepository),
                new StudentService(weekUtils, studentRepository),
                new MarkService(weekUtils, markRepository, taskRepository, studentRepository),
                new ReportsService(taskRepository, studentRepository, markRepository),
                new FiltersService(taskRepository, studentRepository, markRepository));

            ui.Run();
        }
Example #2
0
 public MarkService(
     WeekUtils weekUtils,
     ICrudRepository <string, Mark> repository,
     ICrudRepository <int, Task> taskRepository,
     ICrudRepository <int, Student> studentRepository)
 {
     _weekUtils         = weekUtils;
     _repository        = repository;
     _taskRepository    = taskRepository;
     _studentRepository = studentRepository;
 }
Example #3
0
 public StudentService(WeekUtils weekUtils, ICrudRepository <int, Student> repository)
 {
     _weekUtils  = weekUtils;
     _repository = repository;
 }
Example #4
0
 public TaskService(WeekUtils weekUtils, ICrudRepository <int, Task> repository)
 {
     _weekUtils  = weekUtils;
     _repository = repository;
 }