コード例 #1
0
        private void BtnAgregar_Click(object sender, EventArgs e)
        {
            MedicoAdd frm = new MedicoAdd(null);

            frm.FormClosed += new FormClosedEventHandler(frmMedicoAdd_FormClosed);
            frm.ShowDialog();
        }
コード例 #2
0
        private void DataListado_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string     msj;
            MedicoView item = dataListado.Rows[e.RowIndex].DataBoundItem as MedicoView;

            if (e.ColumnIndex == 0)
            {
                DialogResult result = MessageBox.Show("Realmete desea eliminar el registro", "Clinica", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (result == DialogResult.Yes)
                {
                    msj = obj.Delete(item.idMedico);
                    MessageBox.Show(msj, "Clinica", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            if (e.ColumnIndex == 1)
            {
                MedicoAdd frm = new MedicoAdd(item);
                frm.ShowDialog();
            }
            Mostrar();
        }