Esempio n. 1
0
        private void AddPartButton_Click(object sender, EventArgs e)
        {
            Part       part       = null;
            PartWindow partWindow = new PartWindow(part, _inventory, _inventory.GetNewPartId);

            partWindow.ShowDialog();
            partWindow.Dispose();
        }
Esempio n. 2
0
 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);
     }
 }