コード例 #1
0
 //Действие при нажатии кнопки "Добавить"
 private void addButton_Click(object sender, EventArgs e)
 {
     var result = new Forms.EditForms.TeamEdit().ShowDialog();
     if (result == DialogResult.OK)
     {
         loadData();
     }
 }
コード例 #2
0
        //Действие при нажатии кнопки "Изменить"
        private void editButton_Click(object sender, EventArgs e)
        {
            try
             {
                // int teamID = int.Parse(teamTable.SelectedRows[0].Cells["id"].Value.ToString());
                // var result = new Forms.EditForms.TeamEdit(true, teamID).ShowDialog();

                int teamID = int.Parse(teamTable.SelectedRows[0].Cells["id"].Value.ToString());
                var result = new Forms.EditForms.TeamEdit(true, teamID).ShowDialog();

                if (result == DialogResult.OK)
                    {
                        loadData();
                    }
            }

            catch (Exception exc)
            {
                logger.Error(exc.Message);
                MessageBox.Show("Произошла ошибка при изменении!",
                    "Ошибка",
                    buttons: MessageBoxButtons.OK,
                    icon: MessageBoxIcon.Error);
                return;
            }
        }