Exemplo n.º 1
0
 private void btnAddNew_Click(object sender, EventArgs e)
 {
     using (inputForm = new InputForm(this))
     {
         inputForm.prepareAdding();
         inputForm.ShowDialog();
     }
 }
Exemplo n.º 2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (dgCD.SelectedRows.Count > 0)
     {
         var index = dgCD.SelectedRows[0].Index;
         var list  = (BindingList <CD>)dgCD.DataSource;
         var cd    = list.ElementAtOrDefault(index);
         using (inputForm = new InputForm(this))
         {
             inputForm.prepareEditing(cd);
             inputForm.ShowDialog();
         }
     }
     else
     {
         MessageBox.Show("No rows selected");
     }
 }