示例#1
0
 private void BtAdd_Click(object sender, EventArgs e)
 {
     using (InputDriverForm inForm = new InputDriverForm())
     {
         if (inForm.ShowDialog() == DialogResult.OK)
         {
             drivers.Add(inForm.driver);
             UpdateDgv();
         }
     }
 }
示例#2
0
 private void ChangeRow(DataGridViewRow row)
 {
     using (InputDriverForm inForm = new InputDriverForm((Driver)row.DataBoundItem))
     {
         inForm.EditOrFind();
         if (inForm.DialogResult == DialogResult.OK)
         {
             drivers.Add(inForm.driver);
             UpdateDgv();
         }
     }
 }
示例#3
0
        private void BtEdit_Click(object sender, EventArgs e)
        {
            if (dgv.SelectedRows.Count == 0)
            {
                MessageBox.Show("Выберите строку");
                return;
            }
            int    rowIndex = dgv.SelectedRows[0].Index;
            Driver driver   = (Driver)dgv.SelectedRows[0].DataBoundItem;

            using (InputDriverForm inputBookForm = new InputDriverForm(driver))
            {
                inputBookForm.EditOrFind();
                if (inputBookForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                driver = inputBookForm.driver;
                drivers.Add(driver);
                UpdateDgv();
            }
        }