Esempio n. 1
0
        //creates the cd chamber
        private void btnCreateCDChamber_Click(System.Object sender, System.EventArgs e)
        {
            if (txtCDChamberInstrumentList.Enabled == false)
            {
                FormController.activateCDClassical(this);
                FormController.activateCDChamber(this);
                FormController.deactivateAllButCDChamber(this);
            }
            else
            {
                if (validateCDChamber())
                {
                    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  tempChamberInstList = txtCDChamberInstrumentList.Text;

                    dbFunctions.InsertProduct(tempUPC, tempPrice, txtProductTitle.Text, tempQuant, "CDChamber");
                    dbFunctions.InsertCDClassical(tempUPC, tempCDLabel, tempCDArtist);
                    dbFunctions.InsertCDChamber(tempUPC, tempChamberInstList);
                    MessageBox.Show("CD CHamber added");
                }
            }
        }
Esempio n. 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;
            }
        }