Esempio n. 1
0
        public void ShowEditClientDebt(IFormFactory formFactory,
                                       IClientDebtRepository clientDebtRepository,
                                       int debtId,
                                       IMainController mainController)
        {
            IEditClientDebtForm form = formFactory.CreateEditClientDebtForm();

            ClientDebt clientDebt = clientDebtRepository.GetClientDebtWithId(debtId);

            form.ShowModal(mainController, clientDebt);
        }
Esempio n. 2
0
        public void ShowClientDebts(IViewClientDebtsForm form, IClientDebtRepository clientDebtRepository,
                                    IMainController mainController)
        {
            List <ClientDebt> clientDebts = clientDebtRepository.GetAllClientDebts();

            Subject subject = (Subject)clientDebtRepository;

            subject.Attach((IObserver)form);

            form.ShowModaless(mainController, clientDebts);
        }
Esempio n. 3
0
 public MainController(IFormFactory formFactory, IClientDebtRepository clientDebtRepository,
                       IClientRepository clientRepository, IExerciseRepository exerciseRepository,
                       ITrainingGroupRepository trainingGroupRepository, ITrainingPeriodRepository trainingPeriodRepository,
                       ITrainingRepository trainingRepository)
 {
     this.formFactory              = formFactory;
     this.clientDebtRepository     = clientDebtRepository;
     this.clientRepository         = clientRepository;
     this.exerciseRepository       = exerciseRepository;
     this.trainingGroupRepository  = trainingGroupRepository;
     this.trainingPeriodRepository = trainingPeriodRepository;
     this.trainingRepository       = trainingRepository;
 }
Esempio n. 4
0
 public void RemoveClientDebtWithId(int debtId, IClientDebtRepository clientDebtRepository)
 {
     clientDebtRepository.RemoveClientDebtWithId(debtId);
 }
Esempio n. 5
0
 public void EditClientDebtWithId(int debtId, ClientDebt clientDebt, IClientDebtRepository clientDebtRepository)
 {
     clientDebtRepository.EditClientDebtWithId(debtId, clientDebt);
 }
Esempio n. 6
0
 public void AddClientDebt(ClientDebt clientDebt, IClientDebtRepository clientDebtRepository)
 {
     clientDebtRepository.AddClientDebt(clientDebt);
 }
Esempio n. 7
0
 public void RemoveClientWithOib(string oib, IClientRepository clientRepository, IClientDebtRepository clientDebtRepository)
 {
     if (clientDebtRepository.GetAllDebtsOfClientWithOib(oib).Count == 0)
     {
         clientRepository.RemoveClientWithOib(oib);
     }
     else
     {
         throw new DependantDataNotDeletableException();
     }
 }