示例#1
0
 public CounterService()
 {
     var factory = new DatabaseFactory();
     _activityBusinessLogic = new ActivityBusinessLogic(new ActivityRepository(factory), new TagBusinessLogic(new TagRepository(factory))
         , new DictionaryBusinessLogic<ActivityType>(new DictionaryRepository<ActivityType>(factory)) );
     _contactBusinessLogic = new ContactBusinessLogic(new ContactRepository(factory), new DictionaryBusinessLogic<ContactType>(new DictionaryRepository<ContactType>(factory)),
         new DictionaryBusinessLogic<ContactStatus>(new DictionaryRepository<ContactStatus>(factory)), new DictionaryBusinessLogic<AgeDirection>(new DictionaryRepository<AgeDirection>(factory)),
         new DictionaryBusinessLogic<ReadyToSellState>(new DictionaryRepository<ReadyToSellState>(factory)));
 }
 private void GivenUserEntersFilePath()
 {
     //Arrange
     _filePath                     = "invalidpath.txt";
     _fileBusinessLogic            = new FileBusinessLogic();
     _eventBroker                  = new Mock <IEventBroker>();
     _contactBusinessLogic         = new ContactBusinessLogic(new ContactModelFactory(new MapperService(), _eventBroker.Object));
     _fileService                  = new FileService(_fileBusinessLogic);
     _contactService               = new ContactService(_contactBusinessLogic);
     _outputWriter                 = new ConsoleOutputWriter();
     _configurationSettingProvider = new ConfigurationSettingProvider();
     _contactManager               = new ContactManager(_fileService, _contactService, _outputWriter, _configurationSettingProvider);
     _eventBroker.Setup(x => x.Raise(new ContactRegisteredEvent(_outputWriter)));
 }
示例#3
0
        public static Company ConvertToDbCompany(this CompanyModel model, ICompanyBusinessLogic companyBusinessLogic
            , IContactBusinessLogic contactBusinessLogic)
        {
            var company = companyBusinessLogic.GetById(model.Id);

            company.Comment = model.Comment;
            //company.CreateDate = DateTime.Now;
            company.Name = model.Name;
            company.Sites.AddRange(companyBusinessLogic.GetAllSites(company.Id));
            //company.IsDeleted = false;
            company.Type = companyBusinessLogic.GetAllTypes().First(x => x.Id == model.TypeId);
            company.Size = companyBusinessLogic.GetAllSizes().First(x => x.Id == model.SizeId);
            company.Sector = companyBusinessLogic.GetAllSectors().First(x => x.Id == model.SectorId);
            company.Status = companyBusinessLogic.GetAllStatuses().First(x => x.Id == model.StatusId);
            company.Owner = contactBusinessLogic.GetById(model.OwnerId);
            return company;
        }
示例#4
0
 public ContactsController(IContactBusinessLogic contactBusinessLogic)
 {
     _contactBusinessLogic = contactBusinessLogic;
 }
示例#5
0
 public CompaniesController(ICompanyBusinessLogic companyBusinessLogic, 
     IContactBusinessLogic contactBusinessLogic)
 {
     _companyBusinessLogic = companyBusinessLogic;
     _contactBusinessLogic = contactBusinessLogic;
 }
 public ContactService(
     IContactBusinessLogic contactBusinessLogic
     )
 {
     _contactBusinessLogic = contactBusinessLogic;
 }
示例#7
0
 public ContactController(IMapper mapper, IContactBusinessLogic contactBusinessLogic) : base(mapper)
 {
     this.contactBusinessLogic = contactBusinessLogic;
 }
示例#8
0
 public LeadController(IContactBusinessLogic contactBusinessLogic, ILeadTypeBusinessLogic leadTypeBusinessLogic, ILeadBusinessLogic leadBusinessLogic)
 {
     _contactBusinessLogic = contactBusinessLogic;
     _leadTypeBusinessLogic = leadTypeBusinessLogic;
     _leadBusinessLogic = leadBusinessLogic;
 }