// cancella operatore
 private void datiPazienti_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
     {
         string id = this.datiPazienti[1, e.RowIndex].Value.ToString();
         if (e.Button == MouseButtons.Right)
         {
             DialogResult dialogResult = MessageBox.Show("Sei sicuro di voler eliminare questa riga?", "eliminazione", MessageBoxButtons.YesNo);
             if (dialogResult == DialogResult.Yes)
             {
                 db.esegui(string.Format(@"
                                             DELETE FROM operatori WHERE idop = '{0}'; 
                                             DELETE FROM orelavorate WHERE idop = '{0}';
                                             DELETE FROM turni WHERE ids = '{0}'", id));
                 stampaLista();
             }
         }
         else
         {
             ViewMedico v = new ViewMedico(this.datiPazienti[0, e.RowIndex].Value.ToString());
             this.Hide();
             v.ShowDialog();
             this.Show();
         }
     }
 }
Beispiel #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            ViewMedico v = new ViewMedico(idpe);

            this.Hide();
            v.ShowDialog();
            this.Show();
        }
        private void datiPazienti_CellClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            string id = this.datiPazienti[0, e.RowIndex].Value.ToString();

            if (e.Button == MouseButtons.Right)
            {
                DialogResult dialogResult = MessageBox.Show("Sei sicuro di voler eliminare questa riga?", "eliminazione", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    stampaLista();
                }
            }
            else
            {
                ViewMedico view = new ViewMedico(id);
                this.Hide();
                view.ShowDialog();
                stampaLista();
                this.Show();
            }
        }