示例#1
0
 private void Edit(Inventory item)
 {
   using (InventoryForm form = new InventoryForm(item, false))
   {
     if (form.ShowDialog() != DialogResult.OK)
       item.RejectChanges();
   }
 }
示例#2
0
    private void _btnAdd_Click(object sender, EventArgs e)
    {
      Inventory item = _model.InventoryCreateInstance();

      using (InventoryForm form = new InventoryForm(item, true))
      {
        if (form.ShowDialog() == DialogResult.OK)
        {
          item.AcceptChanges();
          objectBinder.List.Add(item);
        }
      }
    }