Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();

            p = new Presenter(this);

            //Initialize cbDepList
            ObservableCollection <Department> depList = p.GetDepList();

            foreach (var dep in depList)
            {
                cbDepartmentsList.Items.Add($"{dep.Name}, {dep.Location}, {dep.Salary}");
            }

            ////Dep
            btnNewDep.Click    += delegate { p.AddDepartment(); };
            btnDeleteDep.Click += delegate { p.DeleteDepartment(); };


            ////Emp
            btnNewEmp.Click             += delegate { p.AddEmployee(); };
            btnDeleteEmp.Click          += delegate { p.DeleteEmployee(); };
            lvEmployee.SelectionChanged += delegate { p.RefreshDepartmentsListOnEMP(); };
            btnAddDepToEMP.Click        += delegate { p.AddDepartmentToEMP(); };
            btnDelDepFromEMP.Click      += delegate { p.DeleteDepartmentFromEMP(); };
        }