Пример #1
0
        private void LoadData()
        {
            _clientDetailsReport = _reportingRepository.GetByExample <ClientDetailsReport>(new { _clientReport.Id }).FirstOrDefault();

            SetClientDetailsData();
            SetReadOnlyData();
        }
Пример #2
0
        public void Execute(ClientCreatedEvent theEvent)
        {
            var client        = new ClientReport(theEvent.ClientId, theEvent.ClientName);
            var clientDetails = new ClientDetailsReport(theEvent.ClientId, theEvent.ClientName, theEvent.Street, theEvent.StreetNumber, theEvent.PostalCode, theEvent.City, theEvent.PhoneNumber);

            _reportingRepository.Save(client);
            _reportingRepository.Save(clientDetails);
        }
 protected override void SetupDependencies()
 {
     _clientDetailsReport  = new ClientDetailsReport(_clientId, "Client Name", "Street", "123", "5000", "Bergen", "1234567890");
     _clientDetailsReports = new List <ClientDetailsReport> {
         _clientDetailsReport
     };
     OnDependency <IReportingRepository>()
     .Setup(x => x.GetByExample <ClientDetailsReport>(It.IsAny <object>()))
     .Returns(_clientDetailsReports);
 }
Пример #4
0
        protected override void SetupDependencies()
        {
            OnDependency <IReportingRepository>()
            .Setup(x => x.Save(It.IsAny <ClientReport>()))
            .Callback <ClientReport>(a => SaveClientObject = a);

            OnDependency <IReportingRepository>()
            .Setup(x => x.Save(It.IsAny <ClientDetailsReport>()))
            .Callback <ClientDetailsReport>(a => SaveClientDetailsObject = a);
        }
        protected override void SetupDependencies()
        {
            OnDependency <IPopupPresenter>()
            .Setup(x => x.CatchPossibleException(It.IsAny <Action>()))
            .Callback <Action>(x => x());

            _clientDetailsReport  = new ClientDetailsReport(_clientId, "Client Name", "Street", "123", "5000", "Bergen", "1234567890");
            _clientDetailsReports = new List <ClientDetailsReport> {
                _clientDetailsReport
            };
            OnDependency <IReportingRepository>()
            .Setup(x => x.GetByExample <ClientDetailsReport>(It.IsAny <object>()))
            .Returns(_clientDetailsReports);
        }
Пример #6
0
        public void Will_be_able_to_save_and_retrieve_a_client_details_dto()
        {
            var clientDetailsDto = new ClientDetailsReport(Guid.NewGuid(), "Mark Nijhof", "Street", "123", "5006", "Bergen", "123456789");

            _repository.Save(clientDetailsDto);
            var sut = _repository.GetByExample <ClientDetailsReport>(new { ClientName = "Mark Nijhof" }).FirstOrDefault();

            Assert.That(sut.Id, Is.EqualTo(clientDetailsDto.Id));
            Assert.That(sut.ClientName, Is.EqualTo(clientDetailsDto.ClientName));
            Assert.That(sut.Street, Is.EqualTo(clientDetailsDto.Street));
            Assert.That(sut.StreetNumber, Is.EqualTo(clientDetailsDto.StreetNumber));
            Assert.That(sut.PostalCode, Is.EqualTo(clientDetailsDto.PostalCode));
            Assert.That(sut.City, Is.EqualTo(clientDetailsDto.City));
            Assert.That(sut.PhoneNumber, Is.EqualTo(clientDetailsDto.PhoneNumber));
        }
Пример #7
0
        public void SaveNewAddress()
        {
            _popupPresenter.CatchPossibleException(() =>
            {
                _clientDetailsView.DisableSaveButton();
                if (_createNewProcess)
                {
                    _editStep            = 3;
                    _clientDetailsReport = new ClientDetailsReport(
                        _clientDetailsReport.Id,
                        _clientDetailsReport.ClientName,
                        _clientDetailsView.Street,
                        _clientDetailsView.StreetNumber,
                        _clientDetailsView.PostalCode,
                        _clientDetailsView.City,
                        _clientDetailsReport.PhoneNumber);

                    _clientDetailsView.EnablePhoneNumberPanel();
                    return;
                }

                _bus.Publish(new ClientIsMovingCommand(
                                 _clientDetailsReport.Id,
                                 _clientDetailsView.Street,
                                 _clientDetailsView.StreetNumber,
                                 _clientDetailsView.PostalCode,
                                 _clientDetailsView.City));

                _clientDetailsReport = new ClientDetailsReport(
                    _clientDetailsReport.Id,
                    _clientDetailsReport.ClientName,
                    _clientDetailsView.Street,
                    _clientDetailsView.StreetNumber,
                    _clientDetailsView.PostalCode,
                    _clientDetailsView.City,
                    _clientDetailsReport.PhoneNumber);

                EnableAllMenuButtons();
                _clientDetailsView.EnableOverviewPanel();
                _bus.Commit();
                SystemTimer.Trigger(LoadData).In(2000);
            });
        }
Пример #8
0
        public void Display()
        {
            _createNewProcess = false;
            _clientDetailsView.DisableSaveButton();
            DisableAllMenuButtons();
            _clientDetailsView.EnableOverviewPanel();

            if (_clientReport == null)
            {
                _editStep            = 1;
                _createNewProcess    = true;
                _clientDetailsReport = new ClientDetailsReport(Guid.NewGuid(), string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                ResetForm();
                _clientDetailsView.EnableClientNamePanel();
                _clientDetailsView.ShowDialog();
                return;
            }

            LoadData();

            EnableAllMenuButtons();
            _clientDetailsView.ShowDialog();
        }