コード例 #1
0
 public MegaMergeServiceTests()
 {
     _companyA = Substitute.For<ICompanyUnitOfWork>();
     _companyB = Substitute.For<ICompanyUnitOfWork>();
     _mergedCatalog = Substitute.For<IMergedCatalogUnitOfWork>();
     _megaMergeService = new MegaMergeService(_companyA, _companyB, _mergedCatalog);
 }
コード例 #2
0
        private IEnumerable <MergedCatalog> GetMergedCatalogs(ICompanyUnitOfWork company, string sourceName)
        {
            var mergedCatalogs =
                company
                .Catalogs
                .GetAll()
                .Select(x =>
                        new MergedCatalog
            {
                SKU         = x.SKU,
                Description = x.Description,
                Source      = sourceName
            })
                .Distinct()
                .ToList();
            var barcodes = company
                           .Barcodes
                           .GetAll()
                           .ToList();

            mergedCatalogs.ForEach(x =>
            {
                x.Barcodes = barcodes
                             .Where(y => y.SKU == x.SKU)
                             .Select(y => y.Barcode)
                             .ToList();
            });

            return(mergedCatalogs);
        }
コード例 #3
0
 internal GetCompanyCommand(ICompanyUnitOfWork companyUnitOfWork)
 {
     if (companyUnitOfWork == null)
     {
         throw new ArgumentNullException("companyUnitOfWork");
     }
     _companyUnitOfWork = companyUnitOfWork;
 }
コード例 #4
0
 public BauService(
     ICompanyUnitOfWork companyA,
     ICompanyUnitOfWork companyB
     )
 {
     CompanyA = companyA;
     CompanyB = companyB;
 }
コード例 #5
0
 internal AssignCustomerToBrokerCommand(ICompanyUnitOfWork companyUnitOfWork)
 {
     if (companyUnitOfWork == null)
     {
         throw new ArgumentNullException("companyUnitOfWork");
     }
     _companyUnitOfWork = companyUnitOfWork;
 }
コード例 #6
0
 internal ContactCommandBase(ICompanyUnitOfWork companyUnitOfWork)
 {
     if (companyUnitOfWork == null)
     {
         throw new ArgumentNullException("companyUnitOfWork");
     }
     CompanyUnitOfWork = companyUnitOfWork;
 }
コード例 #7
0
 internal RemoveCustomerFromBrokerCommand(ICompanyUnitOfWork companyUnitOfWork)
 {
     if (companyUnitOfWork == null)
     {
         throw new ArgumentNullException("companyUnitOfWork");
     }
     _companyUnitOfWork = companyUnitOfWork;
 }
コード例 #8
0
 public MegaMergeService(
     ICompanyUnitOfWork companyA,
     ICompanyUnitOfWork companyB,
     IMergedCatalogUnitOfWork mergedCatalog
     )
 {
     CompanyA      = companyA;
     CompanyB      = companyB;
     MergedCatalog = mergedCatalog;
 }
コード例 #9
0
        private Catalog SelectCatalogFromCompany(ICompanyUnitOfWork company)
        {
            Console.WriteLine("These are the Catalog B content:");
            var catalogs = company.Catalogs.GetAll();

            catalogs.Dump();
            Console.Write("Please type SKU no:");
            var sku = Console.ReadLine();

            return(catalogs.FirstOrDefault(x => x.SKU == sku));
        }
コード例 #10
0
        private Supplier InputNewSupplier(ICompanyUnitOfWork company)
        {
            Console.Write("Supplier Name: ");
            var name          = Console.ReadLine();
            var maxSupplierId = Convert.ToInt32(company.Suppliers.GetAll().Max(x => x.Id));
            var supplierId    = (maxSupplierId + 1).ToString("00000");
            var supplier      = new Supplier {
                Id   = supplierId,
                Name = name
            };

            return(supplier);
        }
コード例 #11
0
 public SyncDeleteCompanyContact(ICompanyUnitOfWork unitOfWork) : base(unitOfWork)
 {
 }
コード例 #12
0
 internal CustomerNoteConductor(ICompanyUnitOfWork companyUnitOfWork)
 {
     _companyUnitOfWork = companyUnitOfWork;
 }
コード例 #13
0
 internal CreateCompanyCommand(ICompanyUnitOfWork companyUnitOfWork) : base(companyUnitOfWork)
 {
 }
コード例 #14
0
 public BauServiceTests()
 {
     _companyA   = Substitute.For <ICompanyUnitOfWork>();
     _companyB   = Substitute.For <ICompanyUnitOfWork>();
     _bauService = new BauService(_companyA, _companyB);
 }
コード例 #15
0
 public CompanyService(ICompanyUnitOfWork companyUnitOfWork)
 {
     _companyUnitOfWork = companyUnitOfWork;
 }
コード例 #16
0
 internal UpdateContactCommand(ICompanyUnitOfWork companyUnitOfWork) : base(companyUnitOfWork)
 {
 }