private void AddPartButton_Click(object sender, EventArgs e) { Part part = null; PartWindow partWindow = new PartWindow(part, _inventory, _inventory.GetNewPartId); partWindow.ShowDialog(); partWindow.Dispose(); }
private void ModifyPartButton_Click(object sender, EventArgs e) { if (partsDataView.SelectedRows.Count == 1) { var selected = (int)partsDataView.SelectedRows[0].Cells[0].Value; Part part = _inventory.FindPartById(selected); PartWindow partWindow = new PartWindow(part, _inventory, part.PartId); partWindow.ShowDialog(); partsDataView.DataSource = _inventory.Parts; partWindow.Dispose(); } else { MessageBox.Show(SELECT_ITEM); } }