Exemple #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");
                }
            }
        }
Exemple #2
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 #3
0
        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");
                }
            }
        }
Exemple #4
0
        //button click events
        private void btnFind_Click(System.Object sender, System.EventArgs e)
        {
            try
            {
                if (Validation.validateUPC(txtProductUPC.Text))
                {
                    int tempUPC = Convert.ToInt32(txtProductUPC.Text);

                    bool   ok     = false;
                    string record = "";
                    dbFunctions.SelectProductFromProduct(tempUPC, out ok, out record);
                    //thisProductList.Search(tempUPC).Display(this);
                    display(record);
                    FormController.activateAddButtons(this);
                    //thisProductList.Search(Convert.ToInt32(txtProductUPC.Text)).Display(this);
                }
                else
                {
                    MessageBox.Show("INVALID UPC ENTERED MUST BE AN Int ");
                }
            }
            catch
            {
                MessageBox.Show("DB error UPC does not exist");
            }
        }
Exemple #5
0
 //lets user input a upc
 private void btnEnterUPC_Click(System.Object sender, System.EventArgs e)
 {
     if (txtProductUPC.Enabled == false)
     {
         txtProductUPC.Enabled = true;
         FormController.listmode(this);
     }
 }
Exemple #6
0
        }  // end deactivateAllButBook

        // Deactivate all but BookCIS
        public static void deactivateAllButBookCIS(frmBookCDDVDShop f)
        {
            FormController.deactivateCDOrchestra(f);
            FormController.deactivateCDChamber(f);
            FormController.deactivateDVD(f);
            FormController.deactivateAddButtons(f);
            FormController.deactivateCreateButtons(f);
            f.btnCreateBookCIS.Enabled = true;
        }  // end deactivateAllButBookCIS
Exemple #7
0
        //*****This section has the forms load and closing events

        // This sub is called when the form is loaded
        private void frmBookCDDVDShop_Load(System.Object sender, System.EventArgs e)
        {
            // Read serialized binary data file
            //SFManager.ReadFromFile(ref thisProductList, FileName);
            FormController.clear(this);
            ToolTip toolTip1 = new ToolTip();

            // Set initial Tooltips
            toolTip1.SetToolTip(btnCreateBookCIS, ttCreateBookCIS);
            toolTip1.SetToolTip(btnCreateBook, ttCreateBook);
            toolTip1.SetToolTip(btnCreateCDChamber, ttCreateCDOrchestra);
            toolTip1.SetToolTip(btnCreateCDOrchestra, ttCreateDVD);
            toolTip1.SetToolTip(btnCreateDVD, ttCreateCDChamber);

            toolTip1.SetToolTip(btnClear, ttClear);
            toolTip1.SetToolTip(btnDelete, ttDelete);
            toolTip1.SetToolTip(btnEdit, ttEdit);
            toolTip1.SetToolTip(btnFind, ttFind);
            toolTip1.SetToolTip(btnExit, ttExit);

            toolTip1.SetToolTip(txtProductUPC, ttProductUPC);
            toolTip1.SetToolTip(txtProductPrice, ttProductPrice);
            toolTip1.SetToolTip(txtProductQuantity, ttProductQuantity);
            toolTip1.SetToolTip(txtProductTitle, ttProductTitle);
            toolTip1.SetToolTip(txtCDOrchestraConductor, ttCDOrchestraConductor);
            toolTip1.SetToolTip(txtBookISBNLeft, ttBookISBN);
            toolTip1.SetToolTip(txtBookAuthor, ttBookAuthor);
            toolTip1.SetToolTip(txtBookPages, ttBookPages);
            toolTip1.SetToolTip(txtDVDLeadActor, ttDVDLeadActor);
            toolTip1.SetToolTip(txtDVDReleaseDate, ttDVDReleaseDate);
            toolTip1.SetToolTip(txtDVDRunTime, ttDVDRunTime);
            toolTip1.SetToolTip(txtCDClassicalLabel, ttCDClassicalLabel);
            toolTip1.SetToolTip(txtCDClassicalArtists, ttCDClassicalArtists);
            toolTip1.SetToolTip(txtCDOrchestraConductor, ttCDOrchestraConductor);
            toolTip1.SetToolTip(txtCDChamberInstrumentList, ttCDChamberInstrumentList);
            toolTip1.SetToolTip(txtBookCISCISArea, ttBookCISCISArea);
            toolTip1.SetToolTip(btnCreateBookCIS, ttCreateBookCIS);
        } // end frmEBookCDDVDShop_Load
Exemple #8
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;
            }
        }
Exemple #9
0
        } // end frmEBookCDDVDShop_Load

        // Clear textboxes
        private void btnClear_Click(System.Object sender, System.EventArgs e)
        {
            FormController.clear(this);
        }  // end btnClear_Click