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; }
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(); }
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(); } }
private void ToCustomerView(Customer customer) { MainViewModel model = ((MainViewModel)Parent.Parent); Page page = new CustomerSiteEquipmentPage(); page.DataContext = new CustomerViewModel(model, customer); model.CustomerSiteEquipmentPage = page; }
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(); }