private SupplierSelectionView GetSupplierSelectionView(BaseViewModel daddy = null)
        {
            SupplierSelectionView v = new SupplierSelectionView();
            SupplierSelectionViewModel vm = new SupplierSelectionViewModel(this, v);

            if (daddy != null)
            {
                daddy.ChildViewModels.Add(vm);
            }
            return v;
        }
        private ProductSelectionView GetProductSelectionView(BaseViewModel daddy = null)
        {
            ProductSelectionView v = new ProductSelectionView();
            ProductSelectionViewModel vm = new ProductSelectionViewModel(this, v);

            if (daddy != null)
            {
                daddy.ChildViewModels.Add(vm);
            }
            return v;
        }
        private EmployeeSelectionView GetEmployeeSelectionView(BaseViewModel daddy = null)
        {
            EmployeeSelectionView v = new EmployeeSelectionView();
            EmployeeSelectionViewModel vm = new EmployeeSelectionViewModel(this, v);

            if (daddy != null)
            {
                daddy.ChildViewModels.Add(vm);
            }
            return v;
        }
        private CustomerSelectionView GetCustomerSelectionView(BaseViewModel daddy = null)
        {
            CustomerSelectionView v = new CustomerSelectionView();
            CustomerSelectionViewModel vm = new CustomerSelectionViewModel(this, v);

            if (daddy != null)
            {
                daddy.ChildViewModels.Add(vm);
            }
            return v;
        }
        private SupplierInsertView GetSupplierInsertionView(BaseViewModel daddy)
        {
            SupplierInsertView v = new SupplierInsertView();
            SupplierInsertViewModel vm = new SupplierInsertViewModel(this, v);
            vm.ViewData = new SupplierInsertViewData();
            if (daddy != null)
            {
                daddy.ChildViewModels.Add(vm);
            }

            return v;
        }
        private EmployeeInsertView GetEmployeeInsertionView(BaseViewModel daddy)
        {
            EmployeeInsertView v = new EmployeeInsertView();
            EmployeeInsertViewModel vm = new EmployeeInsertViewModel(this, v);
            vm.ViewData = new EmployeeInsertViewData();
            if (daddy != null)
            {
                daddy.ChildViewModels.Add(vm);
            }

            return v;
        }
        private CustomerInsertView GetCustomerInsertionView(BaseViewModel daddy)
        {
            CustomerInsertView v = new CustomerInsertView();
            CustomerInsertViewModel vm = new CustomerInsertViewModel(this, v);
            vm.ViewData = new CustomerInsertViewData();
            if (daddy != null)
            {
                daddy.ChildViewModels.Add(vm);
            }

            return v;
        }
        private ProductInsertView GetProductInsertionView(BaseViewModel daddy)
        {
            ProductInsertView v = new ProductInsertView();
            ProductInsertViewModel vm = new ProductInsertViewModel(this, v);
            vm.ViewData = new ProductInsertViewData();
            if (daddy != null)
            {
                daddy.ChildViewModels.Add(vm);
            }

            return v;
        }
        private BaseView GetCategoryEditView(int catId, BaseViewModel daddy)
        {
            CategoryEditView v = new CategoryEditView();
            CategoryEditViewModel vm = new CategoryEditViewModel(this, v);

            vm.ViewData = GetCategoryEditViewData(catId);

            if (daddy != null)
            {
                daddy.ChildViewModels.Add(vm);
            }

            return v;
        }
        private BaseView GetProductEditView(int empId, BaseViewModel daddy)
        {
            ProductEditView v = new ProductEditView();
            ProductEditViewModel vm = new ProductEditViewModel(this, v);

            vm.ViewData = GetProductEditViewData(empId);

            if (daddy != null)
            {
                daddy.ChildViewModels.Add(vm);
            }

            return v;
        }
        private BaseView GetCustomerEditView(int cusID, BaseViewModel daddy)
        {
            CustomerEditView v = new CustomerEditView();
            CustomerEditViewModel vm = new CustomerEditViewModel(this, v);

            vm.ViewData = GetCustomerEditViewData(cusID);

            if (daddy != null)
            {
                daddy.ChildViewModels.Add(vm);
            }

            return v;
        }
 public void CategorySelectedForEdit(CategoryListItemViewData data, BaseViewModel daddy)
 {
     if (data != null && data.CategoryID != null)
     {
         NotificationResult result = Messenger.NotifyColleagues
         (MessageTypes.MSG_EMPLOYEE_SELECTED_FOR_EDIT, data);
         if (result == NotificationResult.MessageNotRegistered ||
         result == NotificationResult.MessageRegisteredNotHandled)
         {
             // Nothing was out there that handled our message, 
             // so we'll do it ourselves!
             EditCategory((int)data.CategoryID, daddy);
         }
     }
 }
 public void ProductSelectedForEdit(ProductListItemViewData data, BaseViewModel daddy)
 {
     // Check in case we get a null sent to us
     if (data != null && data.ProductID != null)
     {
         NotificationResult result = Messenger.NotifyColleagues
         (MessageTypes.MSG_PRODUCT_SELECTED_FOR_EDIT, data);
         if (result == NotificationResult.MessageNotRegistered ||
         result == NotificationResult.MessageRegisteredNotHandled)
         {
             // Nothing was out there that handled our message, 
             // so we'll do it ourselves!
             EditProduct((int)data.ProductID, daddy);
         }
     }
 }
 private void ViewHandler()
 {
     while (CurrentView != ViewModes.Close)
     {
         Application.Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;
         switch (CurrentView) {
             case ViewModes.Main:
                 ViewWindow MainWindow = new ViewWindow();
                 Current_ViewModel = new LoginViewModel();
                 ((LoginViewModel)Current_ViewModel).OnUserLogin += new LoginViewModel.UserLoginHandler(User_Login);
                 Current_ViewModel.OnUserClosedWindow += new BaseViewModel.WindowsClosedHandler(User_Close);
                 Current_ViewModel.ShowInWindow(MainWindow);
                 break;
             case ViewModes.Editor:
                 ViewWindow EditorWindow = new ViewWindow();
                 Current_ViewModel = new EditViewModel(CurrentUser);
                 ((EditViewModel)Current_ViewModel).OnUserEdited += new EditViewModel.UserEditingHandler(User_Edited);
                 Current_ViewModel.OnUserClosedWindow += new BaseViewModel.WindowsClosedHandler(User_Close);
                 Current_ViewModel.ShowInWindow(EditorWindow);
                 break;
         }
     }
 }
 public void ProductInsertWindow(BaseViewModel daddy)
 {
     BaseView view = GetProductInsertionView(daddy);
     view.ShowInWindow(true, "Insert Product");
 }
 public void EditProduct(int custId, BaseViewModel daddy)
 {
     BaseView view = GetProductEditView(custId, daddy);
     view.ShowInWindow(true, "Edit Product");
 }
 public void OrderSelectedForEdit(OrderListItemViewData data, BaseViewModel daddy)
 {
     throw new NotImplementedException();
 }
 public void EditSupplier(int supID, BaseViewModel daddy)
 {
     BaseView view = GetSupplierEditView(supID, daddy);
     view.ShowInWindow(true, "Edit Supplier");
 }
 public void EditCustomer(int custId, BaseViewModel daddy)
 {
     BaseView view = GetCustomerEditView(custId, daddy);
     view.ShowInWindow(true, "Edit Employee");
 }
 public void CustomerInsertWindow(BaseViewModel daddy)
 {
     BaseView view = GetCustomerInsertionView(daddy);
     view.ShowInWindow(true, "Insert Customer");
 }
 public void EditCategory(int catID, BaseViewModel daddy)
 {
     BaseView view = GetCategoryEditView(catID, daddy);
     view.ShowInWindow(true, "Edit Category");
 }
 public void OrderInsertWindow(BaseViewModel daddy)
 {
     throw new NotImplementedException();
 }
 private void GetTeacherSelectionView(BaseViewModel parrent = null)
 {
     SelectTeacherView v = new SelectTeacherView();
 }
 public void SupplierInsertWindow(BaseViewModel daddy)
 {
     BaseView view = GetSupplierInsertionView(daddy);
     view.ShowInWindow(true, "Insert Supplier");
 }
 private void LoadMakeNewQuizView()
 {
     CurrentViewModel            = new MakeNewQuizViewModel(Data);
     makeNewQuizView.DataContext = CurrentViewModel;
 }
Example #26
0
 public ApplicationViewModel()
 {
     Utils.InitializeCasteActiveRecordFramework();
     _mainViewModel = new MainViewModel();
 }
 private void LoadEditRemoveQuizView()
 {
     CurrentViewModel = new EditRemoveQuizViewModel();
 }
 /// <summary>
 /// A Employee has been selected to be edited
 /// </summary>
 /// <param name="data">The EmployeeListItemViewData of the selected employee
 /// </param>
 /// <param name="daddy">The parent ViewModel</param>
 public void EmployeeInsertWindow(BaseViewModel daddy)
 {
     BaseView view = GetEmployeeInsertionView(daddy);
     view.ShowInWindow(true, "Insert Employee");
 }
 public void EditOrder(int custId, BaseViewModel daddy)
 {
     throw new NotImplementedException();
 }
 public void CategoryInsertWindow(BaseViewModel daddy)
 {
     BaseView view = GetCategoryInsertionView(daddy);
     view.ShowInWindow(true, "Insert Category");
 }
 /// <summary>
 /// Edit the employee with the Id passed
 /// </summary>
 /// <param name="customerId">Id of the employee to be edited</param>
 /// <param name="daddy">The 'parent' ViewModel who will own the
 /// ViewModel that controls the Employee Edit</param>
 public void EditEmployee(int empId, BaseViewModel daddy = null)
 {
     BaseView view = GetEmployeeEditView(empId, daddy);
     view.ShowInWindow(true, "Edit Employee");
 }