コード例 #1
0
 private void MSModifyPartButton_Click(object sender, EventArgs e)
 {
     if (Inventory.CurrPartIndex >= 0)
     {
         this.Hide();
         ModifyPartForm modpart = new ModifyPartForm();
         modpart.ShowDialog();
     }
     else
     {
         MessageBox.Show("There are no parts to modify.", "Error");
     }
 }
コード例 #2
0
 private void modifyPart_Click(object sender, EventArgs e)
 {
     if (Inventory.allParts.Any())
     {
         int partSelected = Convert.ToInt32(partDataGridView.Rows[partDataGridView.CurrentCell.RowIndex].Cells[0].Value);//getting the integer value of the selected part's ID
         this.Hide();
         ModifyPartForm modifyPartScreen = new ModifyPartForm(partSelected);
         modifyPartScreen.ShowDialog();
     }
     else
     {
         MessageBox.Show("There are no parts to modify.", "Error");
     }
 }