Exemple #1
0
        private void btnAddPart_Click(object sender, EventArgs e)
        {
            if (validatePart(txtCost.Text, txtModelNo.Text))
            {
                //instantiate part Object
                Parts myPart = new Parts(txtModelNo.Text, double.Parse(txtCost.Text), cboAddParts.Text, Int32.Parse(txtPartID.Text));


                //INSERT part record into part table
                myPart.addPart();

                //Display Confirmation Message
                MessageBox.Show("Part " + cboAddParts.Text + " Registered", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);

                //reset UI
                txtCost.Clear();
                txtModelNo.Clear();
                txtPartID.Clear();

                txtPartID.Text = Parts.nextPartID().ToString();
            }
        }
Exemple #2
0
 private void frmAddPart_Load(object sender, EventArgs e)
 {
     txtPartID.Text = Parts.nextPartID().ToString("000");
     loadCombo();
 }