public EditEmployee()
        {
            InitializeComponent();

            Models.EmployeesContext DB = new Models.EmployeesContext();

            Department.ItemsSource = DB.Departments.ToList();
            Position.ItemsSource   = DB.Positions.ToList();
        }
Example #2
0
        public EmployeeWin()
        {
            InitializeComponent();

            DB = new Models.EmployeesContext();
            DB.Employees.Load();                                            // загружаем данные
            EmployeesView.ItemsSource = DB.Employees.Local.ToBindingList(); // устанавливаем привязку к кэшу

            Closing += Window_Closing;
        }
Example #3
0
        public DepartmentWin()
        {
            InitializeComponent();

            DB = new Models.EmployeesContext();
            DB.Departments.Load();                                              // загружаем данные
            DepartmentsGrid.ItemsSource = DB.Departments.Local.ToBindingList(); // устанавливаем привязку к кэшу

            Closing += MainWindow_Closing;
        }
Example #4
0
        public AddEmployee()
        {
            InitializeComponent();

            Employee = new Models.Employees();
            EmployeeAdd.DataContext = Employee;

            Models.EmployeesContext DB = new Models.EmployeesContext();

            Department.ItemsSource = DB.Departments.ToList();

            Position.ItemsSource = DB.Positions.ToList();

            DB.Dispose();
        }