Exemplo n.º 1
0
 private void buttonEdit_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedCells.Count != 0)
     {
         int          id        = (int)dataGridView1.SelectedCells[3].Value;
         TimeForVisit visit     = db.TimeForVisitSet.Find(id);
         Form         editVisit = new EditVisit(visit);
         editVisit.ShowDialog();
         LoadData(db.TimeForVisitSet.ToList());
     }
     else
     {
         MessageBox.Show("Выберите приём для редактирования");
     }
 }
Exemplo n.º 2
0
        private void buttonRemoveDocFromJob_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count == 0 || dataGridView1.SelectedCells[0].Value == null)
            {
                MessageBox.Show("Выберите приём", "Ошибка");
            }
            else
            {
                int          id    = (int)dataGridView1.SelectedCells[3].Value;
                TimeForVisit visit = (TimeForVisit)db.TimeForVisitSet.Find(id);

                Form editVisit = new EditVisit(visit);
                editVisit.ShowDialog();
                ReloadForm(true);
            }
            ReloadForm();
        }