private void btnCreateBookCIS_Click(System.Object sender, System.EventArgs e) { if (txtBookCISCISArea.Enabled == false) { //FormController. FormController.activateBookCIS(this); FormController.deactivateAllButBookCIS(this); } else { if (validateBookCis()) { int tempUPC = Convert.ToInt32(txtProductUPC.Text); decimal tempPrice = Convert.ToDecimal(txtProductPrice.Text); int tempQuant = Convert.ToInt32(txtProductQuantity.Text); int tempISBNL = Convert.ToInt32(txtBookISBNLeft.Text); int tempISBNR = Convert.ToInt32(txtBookISBNRight.Text); int tempPages = Convert.ToInt32(txtBookPages.Text); dbFunctions.InsertProduct(tempUPC, tempPrice, txtProductTitle.Text, tempQuant, "BookCis"); dbFunctions.InsertBookCIS(tempUPC, txtBookCISCISArea.Text); MessageBox.Show("NEW CIS BOOK ADDED"); } } }
//edit determines what shows based on the type private void btnEdit_Click(System.Object sender, System.EventArgs e) { bool ok = false; string record = ""; int tempUPC = Convert.ToInt32(txtProductUPC.Text); if (dbFunctions.getProductType() == "Book") { FormController.activateBook(this); FormController.deactivateAllButBook(this); btnCreateBook.Enabled = false; } if (dbFunctions.getProductType() == "BookCis") { FormController.activateBookCIS(this); FormController.deactivateAllButBookCIS(this); btnCreateBookCIS.Enabled = false; } if (dbFunctions.getProductType() == "DVD") { FormController.activateDVD(this); FormController.deactivateAllButDVD(this); btnCreateDVD.Enabled = false; } if (dbFunctions.getProductType() == "CDChamber") { FormController.activateCDOrchestra(this); FormController.deactivateAllButCDOrchestra(this); btnCreateCDOrchestra.Enabled = false; } if (dbFunctions.getProductType() == "CDOrchestra") { FormController.activateCDChamber(this); FormController.deactivateAllButCDChamber(this); btnCreateCDChamber.Enabled = false; } }