Exemple #1
0
        private void TabCtrl()
        {
            // General
            general      = new ProductWizard_General(System.Guid.Empty);
            general.Dock = DockStyle.Fill;
            tpGeneral.Controls.Add(general);

            // Misc
            misc      = new ProductWizard_Misc(System.Guid.Empty);
            misc.Dock = DockStyle.Fill;
            tpMisc.Controls.Add(misc);

            // Order
            order      = new ProductWizard_Order(System.Guid.Empty);
            order.Dock = DockStyle.Fill;
            order.gbPurchaseHistory.Visible = false;
            tpOrder.Controls.Add(order);
        }
Exemple #2
0
        private void tabProduct_SelectedIndexChanged(object sender, EventArgs e)
        {
            //2013.12.18 paulus: Opera 要求准許輸入其他資料才 Save
            //if (tabProduct.SelectedIndex != 0 && this.ProductId == System.Guid.Empty)
            //{
            //    MessageBox.Show("Please save new record before you go to other tab!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //    tabProduct.SelectedIndex = 0;
            //}

            switch (tabProduct.SelectedIndex)
            {
            case 0: break;

            case 1:     // Barcode
                if (!(tpBarcode.Contains(barcode)))
                {
                    Cursor.Current = Cursors.WaitCursor;
                    barcode        = new ProductWizard_Barcode(this.ProductId);
                    barcode.Dock   = DockStyle.Fill;
                    tpBarcode.Controls.Add(barcode);
                    Cursor.Current = Cursors.Default;
                }
                break;

            case 2:     // Quantity
                if (!(tpQty.Contains(quantity)))
                {
                    Cursor.Current = Cursors.WaitCursor;
                    quantity       = new ProductWizard_Quantity(this.ProductId);
                    quantity.Dock  = DockStyle.Fill;
                    //quantity.ProductId = this.ProductId;
                    tpQty.Controls.Add(quantity);
                    Cursor.Current = Cursors.Default;
                }
                break;

            case 3:     // Misc
                if (!(tpMisc.Contains(misc)))
                {
                    Cursor.Current = Cursors.WaitCursor;
                    misc           = new ProductWizard_Misc(this.ProductId);
                    misc.Dock      = DockStyle.Fill;
                    //misc.ProductId = this.ProductId;
                    tpMisc.Controls.Add(misc);
                    Cursor.Current = Cursors.Default;
                }
                break;

            case 4:     // Order
                if (!(tpOrder.Contains(order)))
                {
                    Cursor.Current = Cursors.WaitCursor;
                    order          = new ProductWizard_Order(this.ProductId);
                    order.Dock     = DockStyle.Fill;
                    //order.ProductId = this.ProductId;
                    tpOrder.Controls.Add(order);
                    Cursor.Current = Cursors.Default;
                }
                break;

            case 5:     // Discount
                if (!(tpDiscount.Contains(discount)))
                {
                    Cursor.Current = Cursors.WaitCursor;
                    discount       = new ProductWizard_Discount(this.ProductId);
                    discount.Dock  = DockStyle.Fill;
                    //discount.ProductId = this.ProductId;
                    tpDiscount.Controls.Add(discount);
                    Cursor.Current = Cursors.Default;
                }
                break;
            }
        }