Exemple #1
0
        //creates dvd
        private void btnCreateDVD_Click(System.Object sender, System.EventArgs e)
        {
            if (txtDVDLeadActor.Enabled == false)
            {
                FormController.activateDVD(this);
                FormController.deactivateAllButDVD(this);
            }
            else
            {
                if (validateDVD())
                {
                    string   templeadActor   = txtDVDLeadActor.Text;
                    DateTime tempreleaseDate = Convert.ToDateTime(txtDVDReleaseDate.Text);
                    int      tempRunTime     = Convert.ToInt32(txtDVDRunTime.Text);
                    int      tempUPC         = Convert.ToInt32(txtProductUPC.Text);
                    decimal  tempPrice       = Convert.ToDecimal(txtProductPrice.Text);
                    int      tempQuant       = Convert.ToInt32(txtProductQuantity.Text);

                    dbFunctions.InsertProduct(tempUPC, tempPrice, txtProductTitle.Text, tempQuant, "DVD");
                    dbFunctions.InsertDVD(tempUPC, txtDVDLeadActor.Text, tempreleaseDate, tempRunTime);

                    MessageBox.Show("NEW DVD ADDED");
                }
            }
        }
Exemple #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;
            }
        }