예제 #1
0
        public CustomerLeftViewModel(CustomerViewModel parent)
            : base()     // call base class to initialize the dialogService
        {
            Parent = parent;

            _selectedCustomer = ((CustomerViewModel)Parent).SelectedCustomer;

            Title = "CUSTOMER";
            Label1 = "City: ";
            Label2 = "Company: ";

            LoadCustomerRadioButtonList();

            ReturnVisibility = Visibility.Hidden;
        }
예제 #2
0
        public CustomerViewModel(ViewModelBase parent, Customer selectedCustomer = null)// : base()
        {
            Parent = parent;

            // default to the first customer
            if (selectedCustomer == null)
            {
                SelectedCustomer = new UnitOfWork().CustomerRepository.Get().FirstOrDefault();
            }
            else
            {
                SelectedCustomer = selectedCustomer;
            }

            SetLeftPanel();
        }
예제 #3
0
        public AddEditViewModel(ViewModelBase mainViewModel, object obj) : base()
        {
            _mainViewModel = mainViewModel as MainViewModel;

            if (IsCustomer(obj))
            {
                _isCustomer = true;
                _customer = obj as Customer;
                GetAddEditCustomerPage();
            }
            else if (IsSite(obj))
            {
                _isSite = true;
                _site = obj as Site;
                GetAddEditSitePage();
            }
        }
예제 #4
0
        private void ToCustomerView(Customer customer)
        {
            MainViewModel model = ((MainViewModel)Parent.Parent);

            Page page = new CustomerSiteEquipmentPage();
            page.DataContext = new CustomerViewModel(model, customer);
            model.CustomerSiteEquipmentPage = page;
        }
예제 #5
0
        public AddEditCustomerViewModel(ViewModelBase parent, Customer customer)
        {
            Parent = parent;
            _customer = customer;

            DisplayName = "Customer Data Form";

            Title = string.Format("Customer - {0}", _customer.row_id);
            Company = _customer.BusinessName;
            ParentCompany = _customer.Parent_ID;
            PrimaryContact = _customer.PrimaryContactID;

            GetMainAddressPage();
            GetBillingAddressPage();
        }