Ejemplo n.º 1
0
        private void TCSelectionchanged(object sender, SelectionChangedEventArgs e)
        {
            TabControl tc = sender as TabControl;

            if (tc != null)
            {
                if (tc.SelectedItem == Tabcreate)
                {
                    if (currenttab == "Update")
                    {
                        UCC = new UCCreate(EmployeePositions);
                    }
                    UCCreateContent.Content = UCC;
                    DataGridEmployees.UnselectAll();
                    TabController.SelectedIndex = 0;
                    TabUpdate.Header            = "View Employee";
                    currenttab = "Create";
                }
                if (tc.SelectedItem == TabUpdate)
                {
                    if (DataGridEmployees.SelectedItem != null)
                    {
                        UCUpdateContent.Content     = UCU = new UCUpdate(SelectedEmployee, TabUpdate, EmployeePositions);
                        TabUpdate.Header            = "View Employee";
                        TabController.SelectedIndex = 1;
                        currenttab = "Update";
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (DataGridEmployees.SelectedItem != null)
     {
         DataGrid dg = sender as DataGrid;
         SelectedEmployee            = (Employee)dg.SelectedItem;
         UCUpdateContent.Content     = UCU = new UCUpdate(SelectedEmployee, TabUpdate, EmployeePositions);
         TabController.SelectedIndex = 1;
     }
     else
     {
         DataGrid dg = sender as DataGrid;
         SelectedEmployee = (Employee)dg.SelectedItem;
     }
 }