Beispiel #1
0
        private void AddDepartment(object sender)
        {
            sel_dep = new DepartmentModel();
            DepartmentWindow cw = new DepartmentWindow(sel_dep);

            if (cw.ShowDialog() == true)
            {
                db.AddDepartment(sel_dep);
                db.Save();
                SetData();
            }
        }
Beispiel #2
0
        private void EditDepartment(object sender)
        {
            if (sel_dep != null)
            {
                DepartmentWindow cw = new DepartmentWindow(sel_dep);

                if (cw.ShowDialog() == true)
                {
                    db.UpdateDepartment(sel_dep);
                    db.Save();
                    SetData();
                }
            }
            else
            {
                MessageBox.Show("Вы ничего не выбрали!");
            }
        }