예제 #1
0
 private void EditSelectedItem()
 {
     int id = 0;
     brand b = null;
     if (dgList.SelectedItem != null)
     {
         object sel = dgList.SelectedItem;
         b = (brand)sel;
         id = b.id;
     }
     if (id > 0)
     {
         BrandsEditView v = new BrandsEditView();
         v._id = b.id;
         v.edtName.Text = b.name;
         v.edtDescr.Text = b.description;
         v.ShowDialog();
         ReloadList();
     }
 }
예제 #2
0
 private void CreateItem()
 {
     BrandsEditView v = new BrandsEditView();
     v._id = -1;
     v.ShowDialog();
 }