Ejemplo n.º 1
0
 private DomainModel()
 {
     _carCatalog      = new CarCatalog();
     _customerCatalog = new CustomerCatalog();
     _employeeCatalog = new EmployeeCatalog();
     _saleCatalog     = new SaleCatalog();
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public Tester()
        {
            _products  = new ProductCatalog();
            _customers = new CustomerCatalog();

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

            Setup();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
 public SaveCustomerCommand(CustomerCatalog catalog)
 {
     _catalog = catalog;
 }
Ejemplo n.º 9
0
 public DeleteCommand(CustomerVM Customer, CustomerCatalog customerCatalog)
 {
     _catalog    = customerCatalog;
     _customerVM = Customer;
 }
Ejemplo n.º 10
0
 public NewCustomerCommand(CustomerCatalog catalog, CustomerMasterDetailsViewModel mdvm)
 {
     _catalog = catalog;
     _customerMasterDetailsViewModel = mdvm;
 }
Ejemplo n.º 11
0
 public RefreshCustomerCommand(CustomerMasterDetailsViewModel mdvm, CustomerCatalog catalog)
 {
     _mdvm    = mdvm;
     _catalog = catalog;
 }
Ejemplo n.º 12
0
 public CustomerEditCommand(CustomerVM Customer, CustomerCatalog customerCatalog)
 {
     _catalog    = customerCatalog;
     _customerVM = Customer;
 }
Ejemplo n.º 13
0
 private CustomerController()
 {
     customerCatalog = new CustomerCatalog();
 }
Ejemplo n.º 14
0
 public DeleteCustomerCommand(CustomerCatalog catalog, CustomerMasterDetailsViewModel viewModel)
 {
     _catalog = catalog;
     _customerMasterDetailsView = viewModel;
 }
Ejemplo n.º 15
0
 public OrderTest()
 {
     _orderCatalog    = OrderCatalog.Instance;
     _customerCatalog = CustomerCatalog.Instance;
 }