Example #1
0
        //Вызов окна редактирования записи для Главной таблицы, а также контроль за ним
        private void UpdateInMainTable()
        {
            if (UpdateMail != null)
            {
                if (UpdateMail.IsVisible == true && UpdateMail.IsActive == false)
                {
                    UpdateMail.Activate();
                    return;
                }
            }
            UpdateMail = null;
            UpdateMail = new InsertOrUpdateToMainTable();
            UpdateMail.SetMode(InsertOrUpdateToMainTable.ModeWindow.Update);
            if (dataGrid_MainTable.SelectedIndex >= 0)
            {
                UpdateMail.addData(mailArr[dataGrid_MainTable.SelectedIndex]);
                UpdateMail.Owner      = this;
                UpdateMail.mainWindow = this;

                UpdateMail.Show();
            }
            else
            {
                MessageBox.Show("Выделите запись которую желаете изменить", "Внимание", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
Example #2
0
        //Вызов окна добавления записи для Главной таблицы, а также контроль за ним
        private void InserToMainTable()
        {
            if (InsertMail != null)
            {
                if (InsertMail.IsVisible == true && InsertMail.IsActive == false)
                {
                    InsertMail.Activate();
                    return;
                }
            }
            InsertMail = null;
            InsertMail = new InsertOrUpdateToMainTable();
            InsertMail.SetMode(InsertOrUpdateToMainTable.ModeWindow.Insert);
            InsertMail.mainWindow = this;

            InsertMail.Owner = this;
            InsertMail.Show();
        }