private void LbCustomerList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (LbCustomerList.SelectedItem != null)
            {
                JobController jobControl = new JobController();

                int id = (LbCustomerList.SelectedItem as CustomerController.CustomerViewModel).CusID; //Get Customer ID

                CustomerViewer.DataContext = context.Customers.Find(id);                              //Fill binding data with Customer data found by this ID
                DgJobList.ItemsSource      = jobControl.FillJobShortList(id);                         // Fill job list of cliloyee with this ID
            }
        }
Exemple #2
0
        private void LbEmployeeList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (LbEmployeeList.SelectedItem != null)
            {
                JobController jobControl = new JobController();

                int id = (LbEmployeeList.SelectedItem as EmployeeController.EmployeeViewModel).EmpID; //Get Employee ID

                EmpViewer.DataContext = context.Employees.Find(id);                                   //Fill binding data with Employee data found by this ID
                DgJobList.ItemsSource = jobControl.FillJobShortList(id);                              // Fill job list of employee with this ID
            }
        }