예제 #1
0
        private void Add_button_Click(object sender, EventArgs e)
        {
            Update_button.Hide();
            Delete_button.Hide();
            Add_button.Hide();

            Update_Form UF = Configurate.OptimalView_Form("Add", Update_DGV, RowToEdit, UpdateTable_CB.Text);

            UF.ShowDialog();
            Presenter.GetDGV(Update_DGV, UpdateTable_CB.Text, (int)OperationOption.UpdateRoutes);
        }
예제 #2
0
        private void Delete_button_Click(object sender, EventArgs e)
        {
            DialogResult DR = new DialogResult();

            DR = MessageBox.Show("Строка будет удалена. Продолжить?", "Внимание!", MessageBoxButtons.OKCancel);

            if (DR == DialogResult.OK)
            {
                Presenter.DeleteRow(UpdateTable_CB.Text, Convert.ToInt32(Update_DGV.Rows[RowToEdit].Cells[0].Value));
                Presenter.GetDGV(Update_DGV, UpdateTable_CB.Text, (int)OperationOption.UpdateRoutes);
                Add_button.Hide();
                Update_button.Hide();
                Delete_button.Hide();
            }
        }
예제 #3
0
        private void UpdateTable_CB_SelectedIndexChanged(object sender, EventArgs e)
        {
            Add_button.Hide();
            Update_button.Hide();
            Delete_button.Hide();

            if (UpdateTable_CB.SelectedIndex == (int)TableNames.NotSelected)
            {
                Update_DGV.Hide();
            }
            else
            {
                Presenter.GetDGV(Update_DGV, UpdateTable_CB.Text, (int)OperationOption.UpdateRoutes);
                Update_DGV.Show();
            }
        }
예제 #4
0
        private void Update_DGV_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int row = e.RowIndex;

            if (row >= 0)
            {
                RowToEdit = row;
                Update_button.Show();
                Add_button.Show();
                Delete_button.Show();
            }
            else
            {
                RowToEdit = new int();
                Add_button.Hide();
                Update_button.Hide();
                Delete_button.Hide();
            }
        }