Пример #1
0
        // ----------------------------------------------------------------------------------------------------------

        // HANDLE VISIBLE TEXTBOXES AND BUTTONS ---------------------------------------------------------------------
        private void HideButtons()
        {
            // Hide buttons (except Adds)
            Ok_button.Hide();
            Cancel_button.Hide();
            Edit_button.Hide();
            Delete_button.Hide();
            Add_Tenant_button.Show();
            Add_SP_button.Show();
        }
Пример #2
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);
        }
Пример #3
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();
            }
        }
Пример #4
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();
            }
        }
Пример #5
0
 private void ShowButtons()
 {
     // Hide all buttons (except edit and delete)
     Ok_button.Hide();
     Cancel_button.Hide();
     Add_Tenant_button.Hide();
     Add_SP_button.Hide();
     Edit_button.Show();
     Delete_button.Show();
     if (edit || AddSP || AddTenant)
     {
         Ok_button.Show();
         Cancel_button.Show();
         Edit_button.Hide();
         Delete_button.Hide();
     }
 }
Пример #6
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();
            }
        }