Esempio n. 1
0
        /// <summary>
        /// Добавление департамента
        /// </summary>
        public void AddDepartments()
        {
            EditDep EditDepWindow = new EditDep();

            IDep = EditDepWindow;
            EditDepWindow.ShowDialog();
            if (EditDepWindow.DialogResult.Value)
            {
                Deparments newDep = new Deparments
                {
                    DepName = IDep.DepName
                };
                if (post <Deparments>(ref newDep, $"adddepartments"))
                {
                    db.Add(newDep);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Редактирование департамента
        /// </summary>
        public void EditDepartments()
        {
            if (IMain.curDep == null)
            {
                return;
            }
            EditDep EditDepWindow = new EditDep();

            IDep         = EditDepWindow;
            IDep.DepName = IMain.curDep.DepName;
            EditDepWindow.ShowDialog();
            if (EditDepWindow.DialogResult.Value)
            {
                Deparments newDep = new Deparments
                {
                    DepName = IDep.DepName
                };
                if (post <Deparments>(ref newDep, $"editdepartment/{IMain.curDep.Id}"))
                {
                    IMain.curDep.DepName = newDep.DepName;
                }
            }
        }
Esempio n. 3
0
 private void DepBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     curDep = DepBox.SelectedItem as Deparments;
 }