private void CreateItem() { CarProducersEditView v = new CarProducersEditView(); v._id = -1; v.ShowDialog(); }
private void EditSelectedItem() { int id = 0; car_producer b = null; if (dgList.SelectedItem != null) { object sel = dgList.SelectedItem; b = (car_producer)sel; id = b.id; } if (id > 0) { CarProducersEditView v = new CarProducersEditView(); v._id = b.id; v.edtName.Text = b.name; v.edtDescr.Text = b.descripton; v.ShowDialog(); ReloadList(); } }