示例#1
0
        //creates cd orchestra
        private void btnCreateCDOrchestra_Click(System.Object sender, System.EventArgs e)
        {
            if (txtCDOrchestraConductor.Enabled == false)
            {
                FormController.activateCDClassical(this);
                FormController.activateCDOrchestra(this);
                FormController.deactivateAllButCDOrchestra(this);
            }
            else
            {
                if (validateCDOrchestra())
                {
                    int     tempUPC       = Convert.ToInt32(txtProductUPC.Text);
                    decimal tempPrice     = Convert.ToDecimal(txtProductPrice.Text);
                    int     tempQuant     = Convert.ToInt32(txtProductQuantity.Text);
                    string  tempCDArtist  = txtCDClassicalArtists.Text;
                    string  tempCDLabel   = txtCDClassicalLabel.Text;
                    string  tempConductor = txtCDOrchestraConductor.Text;
                    dbFunctions.InsertProduct(tempUPC, tempPrice, txtProductTitle.Text, tempQuant, "CDOrchestra");
                    dbFunctions.InsertCDClassical(tempUPC, tempCDLabel, tempCDArtist);
                    dbFunctions.InsertCDChamber(tempUPC, tempConductor);

                    MessageBox.Show("CD Orchestra added");
                }
            }
        }
示例#2
0
        //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;
            }
        }