Exemplo n.º 1
0
        // Корректное завершение работы
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);
            if (!goToMain)
            {
                DialogResult result = MessageBox.Show("Хотите вернуться на форму авторизации?",
                                                      "Сообщение",
                                                      MessageBoxButtons.YesNoCancel,
                                                      MessageBoxIcon.Information,
                                                      MessageBoxDefaultButton.Button1,
                                                      MessageBoxOptions.DefaultDesktopOnly);

                if (result == DialogResult.Yes)
                {
                    startForm.Show();
                    startForm.Activate();
                }
                else if (result == DialogResult.No)
                {
                    startForm.Close();
                }
                else
                {
                    TableOfList newForm = new TableOfList(username, startForm, ID, creator, name);
                    newForm.Show();
                    newForm.Activate();
                    this.Close();
                }
            }
        }
Exemplo n.º 2
0
        //Обработка создания нового списка
        private void NewListButton_Click(object sender, EventArgs e)
        {
            // И тут тоже до конструктора
            TempFunction();
            TableOfList nextForm = new TableOfList(username, startForm);

            goToList = true;
            nextForm.Show();
            this.Close();
        }
Exemplo n.º 3
0
        // Переход на форму списка
        private void GoToListButton_Click(object sender, EventArgs e)
        {
            goToList = true;
            // Вот тут мы вызываем "костыль" до конструктора
            TempFunction();
            TableOfList nextForm = new TableOfList(username,
                                                   startForm,
                                                   ListsTable.CurrentRow.Cells[2].Value.ToString(),
                                                   ListsTable.CurrentRow.Cells[3].Value.ToString(),
                                                   ListsTable.CurrentRow.Cells[1].Value.ToString());

            nextForm.Show();
            this.Close();
        }