Example #1
0
 private DomainModel()
 {
     _carCatalog      = new CarCatalog();
     _customerCatalog = new CustomerCatalog();
     _employeeCatalog = new EmployeeCatalog();
     _saleCatalog     = new SaleCatalog();
 }
Example #2
0
        private List <CustomerItemViewModel> CreateItemViewModelCollection(CustomerCatalog catalog)
        {
            List <CustomerItemViewModel> items = new List <CustomerItemViewModel>();

            foreach (var obj in catalog.Customers)
            {
                items.Add(new CustomerItemViewModel(obj));
            }
            return(items);
        }
Example #3
0
        public Tester()
        {
            _products  = new ProductCatalog();
            _customers = new CustomerCatalog();

            _orders   = new List <Order>();
            _invoices = new List <Invoice>();

            Setup();
        }
Example #4
0
        public void AddCustomer()
        {
            CustomerCatalog cc           = new CustomerCatalog();
            int             numberBefore = cc.Count;
            Customer        c1           = new Customer(2, "john", "Undulatsvej", "78674523");

            cc.AddCustomer(c1);
            int numberAfter = cc.Count;

            Assert.AreEqual(numberBefore + 1, numberAfter);
        }
Example #5
0
 public CustomerMasterDetailsViewModel()
 {
     _catalog = new CustomerCatalog();
     _customerItemViewModel = new CustomerItemViewModel(new Customer());
     _deleteCommand         = new DeleteCustomerCommand(_catalog, this);
     _newCommand            = new NewCustomerCommand(_catalog, this);
     _saveCommand           = new SaveCustomerCommand(_catalog);
     _refreshCommand        = new RefreshCustomerCommand(this, _catalog);
     RefreshCustomerItemViewModelCollection();
     _catalog.Load();
 }
Example #6
0
 private DomainModel()
 {
     _contactCatalog  = new ContactCatalog();
     _customerCatalog = new CustomerCatalog();
     _leadCatalog     = new LeadCatalog();
     _locationCatalog = new LocationCatalog();
     _offerCatalog    = new OfferCatalog();
     _pipelineCatalog = new PipelineCatalog();
     _productCatalog  = new ProductCatalog();
     _userCatalog     = new UserCatalog();
 }
        public void AddCustomerTest()
        {
            //Arrange
            ICustomerCatalog catalog = new CustomerCatalog();
            int      numberBefore    = catalog.Count;
            Customer c1 = new Customer("Mads", "over there", 1, "10 10 10 10");

            //Act
            catalog.AddCustomer(c1);
            int numberAfter = catalog.Count;

            //Assert
            Assert.AreEqual(numberBefore + 1, numberAfter);
        }
Example #8
0
 public SaveCustomerCommand(CustomerCatalog catalog)
 {
     _catalog = catalog;
 }
Example #9
0
 public DeleteCommand(CustomerVM Customer, CustomerCatalog customerCatalog)
 {
     _catalog    = customerCatalog;
     _customerVM = Customer;
 }
Example #10
0
 public NewCustomerCommand(CustomerCatalog catalog, CustomerMasterDetailsViewModel mdvm)
 {
     _catalog = catalog;
     _customerMasterDetailsViewModel = mdvm;
 }
Example #11
0
 public RefreshCustomerCommand(CustomerMasterDetailsViewModel mdvm, CustomerCatalog catalog)
 {
     _mdvm    = mdvm;
     _catalog = catalog;
 }
Example #12
0
 public CustomerEditCommand(CustomerVM Customer, CustomerCatalog customerCatalog)
 {
     _catalog    = customerCatalog;
     _customerVM = Customer;
 }
Example #13
0
 private CustomerController()
 {
     customerCatalog = new CustomerCatalog();
 }
 public DeleteCustomerCommand(CustomerCatalog catalog, CustomerMasterDetailsViewModel viewModel)
 {
     _catalog = catalog;
     _customerMasterDetailsView = viewModel;
 }
Example #15
0
 public OrderTest()
 {
     _orderCatalog    = OrderCatalog.Instance;
     _customerCatalog = CustomerCatalog.Instance;
 }