Пример #1
0
        private void advisorsGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            selectedrow = advisorsGridView.CurrentCell.RowIndex;
            DataGridViewRow row = advisorsGridView.Rows[selectedrow];

            if (e.ColumnIndex == 3)
            {
                GeneralID.selectedObjectid = (int)row.Cells[0].Value;
                Add_Advisor add = new Add_Advisor();
                this.Hide();
                add.Show();
            }
            else if (e.ColumnIndex == 4)
            {
                DialogResult dr = MessageBox.Show("Are you sure want delete this Advisor", "Delete Advisor", MessageBoxButtons.OKCancel,
                                                  MessageBoxIcon.Question);

                if (dr == DialogResult.OK)
                {
                    int    selectId           = (int)row.Cells[0].Value;
                    string deleteAdvisorQuery = string.Format("delete Advisor where Id='{0}'", selectId);
                    DataBaseConnection.getInstance().executeQuery(deleteAdvisorQuery);

                    MessageBox.Show("Advisor deleted Successfully");
                    this.load_data_in_gridview();
                }
            }
        }
Пример #2
0
        private void addAdvisorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Add_Advisor addAdvisor = new Add_Advisor();

            this.Hide();
            addAdvisor.Show();
        }
Пример #3
0
        private void picBxAddNew_Click(object sender, EventArgs e)
        {
            Add_Advisor newAdvisor = new Add_Advisor();

            this.Hide();
            newAdvisor.Show();
        }