Example #1
0
        private void CreateVendor()
        {
            _vendor1 = new Vendor
            {
                Company = "Some Company1",
                Phone   = "555.123.4567",
                Fax     = "123.456.7891",
                Website = "www.somewebsite1.com",
                LogoUrl = "someurl1",
                Notes   = "notes1"
            };

            _vendor2 = new Vendor
            {
                Company = "Some Company2",
                Phone   = "555.123.4567",
                Fax     = "123.456.7891",
                Website = "www.somewebsite2.com",
                LogoUrl = "someurl2",
                Notes   = "notes2"
            };

            _vendor1.AddProduct(_fertilizer1);
            _vendor1.AddProduct(_fertilizer2);
            _vendor2.AddProduct(_fertilizer1);
            _vendor2.AddProduct(_fertilizer2);

            _vendor1.AddProduct(_chemical1);
            _vendor1.AddProduct(_chemical2);
            _vendor2.AddProduct(_chemical1);
            _vendor2.AddProduct(_chemical2);

            _vendor1.AddProduct(_materials1);
            _vendor1.AddProduct(_materials2);
            _vendor2.AddProduct(_materials1);
            _vendor2.AddProduct(_materials2);

            _vendor1.AddProduct(_seed1);
            _vendor1.AddProduct(_seed2);
            _vendor2.AddProduct(_seed1);
            _vendor2.AddProduct(_seed2);

            _repository.Save(_vendor1);
            _repository.Save(_vendor2);

            var purchaseOrder1 = new PurchaseOrder {
                Vendor = _vendor1, DateCreated = DateTime.Parse("1/5/2009"), Status = TemporalStatus.Complete.Key
            };
            var poli1 = new PurchaseOrderLineItem()
            {
                Product         = _fertilizer1,
                Price           = 10,
                QuantityOrdered = 5,
                Tax             = 5
            };

            var poli2 = new PurchaseOrderLineItem()
            {
                Product         = _fertilizer1,
                Price           = 10,
                QuantityOrdered = 5,
                Tax             = 5
            };

            var poli3 = new PurchaseOrderLineItem()
            {
                Product         = _materials1,
                Price           = 10,
                QuantityOrdered = 5,
                Tax             = 5
            };

            var poli4 = new PurchaseOrderLineItem()
            {
                Product         = _materials2,
                Price           = 10,
                QuantityOrdered = 5,
                Tax             = 5
            };

            var poli5 = new PurchaseOrderLineItem()
            {
                Product         = _chemical2,
                Price           = 10,
                QuantityOrdered = 5,
                Tax             = 5
            };

            var poli6 = new PurchaseOrderLineItem()
            {
                Product         = _chemical1,
                Price           = 10,
                QuantityOrdered = 5,
                Tax             = 5
            };

            purchaseOrder1.AddLineItem(poli1);
            purchaseOrder1.AddLineItem(poli2);
            purchaseOrder1.AddLineItem(poli3);
            purchaseOrder1.AddLineItem(poli4);
            purchaseOrder1.AddLineItem(poli5);
            purchaseOrder1.AddLineItem(poli6);
            _vendor1.AddPurchaseOrder(purchaseOrder1);
            _repository.Save(_vendor1);
        }