コード例 #1
0
        }  // end activateCDCLChamber

        // Enables Worker textboxes and highlights the Graduate Student groupbox
        public static void activateCDOrchestra(frmBookCDDVDShop f)
        {
            activateCDClassical(f);  // CDClassical must be activated too
            f.grpCDOrchestra.Enabled          = true;
            f.grpCDOrchestra.BackColor        = Color.LimeGreen;
            f.txtCDOrchestraConductor.Enabled = true;
        }  // end activateCDClOrch
コード例 #2
0
        }  // end activateCDClOrch

        // Enables BookCIS textboxes and highlights the BookCIS groupbox
        public static void activateBookCIS(frmBookCDDVDShop f)
        {
            activateBook(f);  // Book must be activated too
            f.grpBookCIS.Enabled        = true;
            f.grpBookCIS.BackColor      = Color.LimeGreen;
            f.txtBookCISCISArea.Enabled = true;
        }  // end activateWorker
コード例 #3
0
        }  // end formAddMode

        public static void listmode(frmBookCDDVDShop f)
        {
            f.btnDelete.Enabled         = true;
            f.btnEdit.Enabled           = true;
            f.btnFind.Enabled           = true;
            f.btnSaveEditUpdate.Enabled = true;
        }
コード例 #4
0
        }  // end deactivateProduct

        // Disables CDClassical textboxes and groupbox
        public static void deactivateCDClassical(frmBookCDDVDShop f)
        {
            deactivateCDChamber(f);
            deactivateCDOrchestra(f);
            f.grpCDClassical.Enabled   = false;
            f.grpCDClassical.BackColor = Color.Red;
        }  // end deactivateCDClassical
コード例 #5
0
        }  // end Save

        // Display data in object on form
        public override void Display(frmBookCDDVDShop f)
        {
            base.Display(f);
            f.txtDVDLeadActor.Text   = hiddenLeadActor;
            f.txtDVDReleaseDate.Text = hiddenReleaseDate.ToString();
            f.txtDVDRunTime.Text     = hiddenRunTime.ToString();
        }  // end Display
コード例 #6
0
 //save
 public override void Save(frmBookCDDVDShop f)
 {
     base.Save(f);
     hiddenLeadActor   = f.txtDVDLeadActor.Text;
     hiddenReleaseDate = Convert.ToDateTime(f.txtDVDReleaseDate.Text);
     hiddenRunTime     = Convert.ToInt32(f.txtDVDRunTime.Text);
 }  // end Save
コード例 #7
0
ファイル: Product.cs プロジェクト: QMallon/Project4_3309
        }     // end Property


        // Save data from form to object
        public virtual void Save(frmBookCDDVDShop f)
        {
            hiddenUPC      = Convert.ToInt32(f.txtProductUPC.Text);
            hiddenPrice    = Convert.ToDecimal(f.txtProductPrice.Text);
            hiddenTitle    = f.txtProductTitle.Text;
            hiddenQuantity = Convert.ToInt32(f.txtProductQuantity.Text);
        }  // end Save
コード例 #8
0
        }  // end activateBook

        // Enables CDCl Chamber Nusic textboxes and highlights the CDCl Chamber Music groupbox
        public static void activateCDChamber(frmBookCDDVDShop f)
        {
            activateCDClassical(f);   // CD Classical must be activated too
            f.grpCDChamber.Enabled               = true;
            f.grpCDChamber.BackColor             = Color.LimeGreen;
            f.txtCDChamberInstrumentList.Enabled = true;
        }  // end activateCDCLChamber
コード例 #9
0
ファイル: Product.cs プロジェクト: QMallon/Project4_3309
        }  // end Save

        // Display data in object on form
        public virtual void Display(frmBookCDDVDShop f)
        {
            f.txtProductUPC.Text      = hiddenUPC.ToString();
            f.txtProductPrice.Text    = hiddenPrice.ToString();
            f.txtProductTitle.Text    = hiddenTitle;
            f.txtProductQuantity.Text = hiddenQuantity.ToString();
        }  // end Display
コード例 #10
0
        }  // end activateAddButtons

        // Enable/disable buttons when not in edit mode
        public static void deactivateAddButtons(frmBookCDDVDShop f)
        {
            f.btnCreateCDOrchestra.Enabled = false;
            f.btnCreateDVD.Enabled         = false;
            f.btnCreateCDChamber.Enabled   = false;
            f.btnCreateBook.Enabled        = false;
            f.btnCreateBookCIS.Enabled     = false;
        }  // end deactivateAddButtons
コード例 #11
0
        }  // end deactivateAllButCDOrchestra

        // Activates and deactivates necessary form buttons
        //    when in add mode
        public static void formAddMode(frmBookCDDVDShop f)
        {
            f.btnClear.Enabled          = true;
            f.btnDelete.Enabled         = false;
            f.btnEdit.Enabled           = false;
            f.btnFind.Enabled           = false;
            f.btnSaveEditUpdate.Enabled = true;
        }  // end formAddMode
コード例 #12
0
ファイル: Book.cs プロジェクト: QMallon/Project4_3309
        }  // end Save

        //display
        public override void Display(frmBookCDDVDShop f)
        {
            base.Display(f);
            f.txtBookAuthor.Text    = hiddenAuthor;
            f.txtBookISBNLeft.Text  = hiddenISBNleft.ToString();
            f.txtBookISBNRight.Text = hiddenISBNright.ToString();
            f.txtBookPages.Text     = hiddenPages.ToString();
        }
コード例 #13
0
ファイル: Book.cs プロジェクト: QMallon/Project4_3309
 //save
 public override void Save(frmBookCDDVDShop f)
 {
     base.Save(f);
     hiddenISBNleft  = Convert.ToInt32(f.txtBookISBNLeft.Text);
     hiddenISBNright = Convert.ToInt32(f.txtBookISBNRight.Text);
     hiddenAuthor    = f.txtBookAuthor.Text;
     hiddenPages     = Convert.ToInt32(f.txtBookPages.Text);
 }  // end Save
コード例 #14
0
        }  // end activateWorker

        // ***** Disables Product textboxes and highlights the Product groupbox
        public static void deactivateProduct(frmBookCDDVDShop f)
        {
            deactivateCDClassical(f);
            deactivateBook(f);
            deactivateDVD(f);
            f.grpProduct.Enabled   = false;
            f.grpProduct.BackColor = Color.Red;
        }  // end deactivateProduct
コード例 #15
0
        }  // end deactivateAddButtons

        //  Enables Product textboxes and highlights the Product groupbox
        public static void activateProduct(frmBookCDDVDShop f)
        {
            f.grpProduct.Enabled         = true;
            f.grpProduct.BackColor       = Color.LimeGreen;
            f.txtProductUPC.Enabled      = true;
            f.txtProductPrice.Enabled    = true;
            f.txtProductTitle.Enabled    = true;
            f.txtProductQuantity.Enabled = true;
        }  // end activateProduct
コード例 #16
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
コード例 #17
0
        }  // end Parameterized Constructor

        // Resets form to initial state after form is loaded or
        //    an add operation is performed

        public static void resetForm(frmBookCDDVDShop f)
        {
            //  Reset button components
            f.btnClear.Enabled             = true;
            f.btnDelete.Enabled            = false;
            f.btnEdit.Enabled              = false;
            f.btnFind.Enabled              = false;
            f.btnExit.Enabled              = true;
            f.btnSaveEditUpdate.Enabled    = false;
            f.btnEnterUPC.Enabled          = true;
            f.btnCreateBook.Enabled        = true;
            f.btnCreateBook.Text           = "Create Book";
            f.btnCreateBookCIS.Enabled     = true;
            f.btnCreateBookCIS.Text        = "Create Book CIS";
            f.btnCreateCDOrchestra.Enabled = true;
            f.btnCreateCDOrchestra.Text    = "Create CD Orchestra";
            f.btnCreateCDChamber.Enabled   = true;
            f.btnCreateCDChamber.Text      = "Create CD Chamber";
            f.btnCreateDVD.Enabled         = true;
            f.btnCreateDVD.Text            = "Create DVD";

            // Reset group components
            f.grpProduct.Enabled       = true;
            f.grpProduct.BackColor     = Color.Gainsboro;
            f.grpCDClassical.Enabled   = false;
            f.grpCDClassical.BackColor = Color.Gainsboro;
            f.grpBook.Enabled          = false;
            f.grpBook.BackColor        = Color.Gainsboro;
            f.grpCDChamber.Enabled     = false;
            f.grpCDChamber.BackColor   = Color.Gainsboro;
            f.grpCDOrchestra.Enabled   = false;
            f.grpCDOrchestra.BackColor = Color.Gainsboro;
            f.grpBookCIS.BackColor     = Color.Gainsboro;
            f.grpBookCIS.Enabled       = false;
            f.grpDVD.BackColor         = Color.Gainsboro;
            f.grpDVD.Enabled           = false;


            // Reset Text boxes
            // f.txtProductUPC.Focus();
            f.txtProductUPC.Enabled              = false;
            f.txtProductPrice.Enabled            = false;
            f.txtProductTitle.Enabled            = false;
            f.txtProductQuantity.Enabled         = false;
            f.txtBookISBNLeft.Enabled            = false;
            f.txtBookISBNRight.Enabled           = false;
            f.txtBookAuthor.Enabled              = false;
            f.txtBookPages.Enabled               = false;
            f.txtDVDLeadActor.Enabled            = false;
            f.txtDVDReleaseDate.Enabled          = false;
            f.txtDVDRunTime.Enabled              = false;
            f.txtCDClassicalLabel.Enabled        = false;
            f.txtCDClassicalArtists.Enabled      = false;
            f.txtCDChamberInstrumentList.Enabled = false;
            f.txtCDOrchestraConductor.Enabled    = false;
            f.txtBookCISCISArea.Enabled          = false;
        } // end resetForm
コード例 #18
0
        }  // end activateProduct

        //  Enables CDClassical textboxes and highlights the CDClassical groupbox
        public static void activateCDClassical(frmBookCDDVDShop f)
        {
            activateProduct(f);
            f.grpCDClassical.Enabled        = true;
            f.grpCDClassical.BackColor      = Color.LimeGreen;
            f.grpBook.BackColor             = Color.Red;
            f.grpDVD.BackColor              = Color.Red;
            f.txtCDClassicalLabel.Enabled   = true;
            f.txtCDClassicalArtists.Enabled = true;
        }  // end ActivateCDCLassical
コード例 #19
0
        }  // end activateBook

        // Enables DVD textboxes and highlights the DVD groupbox
        public static void activateDVD(frmBookCDDVDShop f)
        {
            activateProduct(f);
            f.grpDVD.Enabled            = true;
            f.grpDVD.BackColor          = Color.LimeGreen;
            f.grpCDClassical.BackColor  = Color.Red;
            f.grpBook.BackColor         = Color.Red;
            f.txtDVDLeadActor.Enabled   = true;
            f.txtDVDReleaseDate.Enabled = true;
            f.txtDVDRunTime.Enabled     = true;
        }  // end activateBook
コード例 #20
0
        }  // end ActivateCDCLassical

        // Enables Book textboxes and highlights the Book groupbox
        public static void activateBook(frmBookCDDVDShop f)
        {
            activateProduct(f);
            f.grpBook.Enabled          = true;
            f.grpBook.BackColor        = Color.LimeGreen;
            f.grpCDClassical.BackColor = Color.Red;
            f.grpDVD.BackColor         = Color.Red;
            f.txtBookISBNLeft.Enabled  = true;
            f.txtBookISBNRight.Enabled = true;
            f.txtBookAuthor.Enabled    = true;
            f.txtBookPages.Enabled     = true;
        }  // end activateBook
コード例 #21
0
ファイル: Product.cs プロジェクト: QMallon/Project4_3309
        }  // end ToString

        public virtual bool validate(frmBookCDDVDShop f)
        {
            bool check = true;

            try
            {
                //check = Convert.ToInt32(f.txtProductUPC.Text);
                check = Decimal.Parse(f.txtProductPrice.Text) > 0;
                //check =  f.txtProductTitle.Text;
                check = Convert.ToInt32(f.txtProductQuantity.Text) > 0;
                return(check);
            }
            catch
            {
                MessageBox.Show("Invalid data");
                return(false);
            }
        }
コード例 #22
0
        }  // end deativateBookCIS

        // Clear all textboxes on the form
        public static void clear(frmBookCDDVDShop f)
        {
            f.txtProductUPC.Text              = "";
            f.txtProductPrice.Text            = "";
            f.txtProductTitle.Text            = "";
            f.txtProductQuantity.Text         = "";
            f.txtBookISBNLeft.Text            = "";
            f.txtBookISBNRight.Text           = "";
            f.txtBookAuthor.Text              = "";
            f.txtBookPages.Text               = "";
            f.txtCDClassicalLabel.Text        = "";
            f.txtCDClassicalArtists.Text      = "";
            f.txtCDChamberInstrumentList.Text = "";
            f.txtCDOrchestraConductor.Text    = "";
            f.txtBookCISCISArea.Text          = "";
            f.txtDVDLeadActor.Text            = "";
            f.txtDVDReleaseDate.Text          = "";
            f.txtDVDRunTime.Text              = "";
            resetForm(f);
        } // end Clear
コード例 #23
0
        }  // end deativateBookCIS

        // Disables  textboxes groupbox
        public static void deactivateDVD(frmBookCDDVDShop f)
        {
            f.grpDVD.Enabled   = false;
            f.grpDVD.BackColor = Color.Red;
        }  // end deativateBookCIS
コード例 #24
0
        }  // end deactivateCDChamber

        // Disables CD Orchestra textboxes and the CD Orchestra groupbox
        public static void deactivateCDOrchestra(frmBookCDDVDShop f)
        {
            f.grpCDOrchestra.Enabled   = false;
            f.grpCDOrchestra.BackColor = Color.Red;
        }  // end deativateCDClOrch
コード例 #25
0
        }  // end deactivateBook

        // Disables CDClChamber textboxes and highlights the CD Chamber groupbox
        public static void deactivateCDChamber(frmBookCDDVDShop f)
        {
            f.grpCDChamber.Enabled   = false;
            f.grpCDChamber.BackColor = Color.Red;
        }  // end deactivateCDChamber
コード例 #26
0
        }  // end deactivateCDClassical

        // Disables Book textboxes and groupbox
        public static void deactivateBook(frmBookCDDVDShop f)
        {
            deactivateBookCIS(f);
            f.grpBook.Enabled   = false;
            f.grpBook.BackColor = Color.Red;
        }  // end deactivateBook
コード例 #27
0
ファイル: BookCIS.cs プロジェクト: QMallon/Project4_3309
        }  // end Save

        public override void Display(frmBookCDDVDShop f)
        {
            base.Display(f);
            f.txtBookCISCISArea.Text = hiddenCISArea;
        }
コード例 #28
0
ファイル: CDOrchestra.cs プロジェクト: QMallon/Project4_3309
 public override void Save(frmBookCDDVDShop f)
 {
     base.Save(f);
     hiddenConductor = f.txtCDOrchestraConductor.Text;
 } // end Save
コード例 #29
0
ファイル: CDOrchestra.cs プロジェクト: QMallon/Project4_3309
        } // end Save

        // Display data in object on form
        public override void Display(frmBookCDDVDShop f)
        {
            base.Display(f);
            f.txtCDOrchestraConductor.Text = hiddenConductor;
        }  // end Display
コード例 #30
0
 // Parametrized Constructor
 public FormController(frmBookCDDVDShop parentForm)
 {
     f = parentForm;
 }  // end Parameterized Constructor