Пример #1
0
        private void ViewProduct_Click(object sender, EventArgs e)
        {
            Debug.Print("ViewProduct");
            ViewProduct viewProduct = new ViewProduct();

            viewProduct.Size = new System.Drawing.Size(1000, 700);
            viewProduct.Show();
        }
Пример #2
0
        private void SetupMenu()
        {
            ToolStripMenuItem submenu;
            var menuStrip = new MenuStrip();

            menuStrip.Location = new Point(0, 0);

            var menuExcel = new ToolStripMenuItem();

            menuStrip.Items.Add(menuExcel);
            menuExcel.Name = "Excel";
            menuExcel.Text = "Excel";
            submenu        = new ToolStripMenuItem();
            submenu.Name   = "Read Excel";
            submenu.Text   = "Read Excel";
            submenu.Click += delegate(Object o, EventArgs e)
            {
                ReadProduct readProduct = new ReadProduct();
                readProduct.Show();
            };
            menuExcel.DropDownItems.Add(submenu);


            var menuTaxes = new ToolStripMenuItem();

            menuStrip.Items.Add(menuTaxes);
            menuTaxes.Name   = "Taxes";
            menuTaxes.Text   = "Taxes";
            menuTaxes.Click += delegate(Object o, EventArgs e)
            {
                ProvinceTaxesForm provinceTaxesForm = new ProvinceTaxesForm();
                provinceTaxesForm.Size = new System.Drawing.Size(300, 500);
                provinceTaxesForm.Show();
            };



            var menuProducts = new ToolStripMenuItem();

            menuStrip.Items.Add(menuProducts);
            menuProducts.Name = "Products";
            menuProducts.Text = "Products";
            submenu           = new ToolStripMenuItem();
            submenu.Name      = "Add";
            submenu.Text      = "Add";
            submenu.Click    += delegate(Object o, EventArgs e)
            {
                ProductForm productForm = new ProductForm();
                productForm.Font = new Font(productForm.Font.Name, productForm.Font.Size + 1, productForm.Font.Style);
                productForm.Show();
            };
            menuProducts.DropDownItems.Add(submenu);
            submenu        = new ToolStripMenuItem();
            submenu.Name   = "View";
            submenu.Text   = "View";
            submenu.Click += delegate(Object o, EventArgs e)
            {
                ViewProduct viewProduct = new ViewProduct();
                viewProduct.Size = new System.Drawing.Size(1000, 700);
                viewProduct.Show();
            };
            menuProducts.DropDownItems.Add(submenu);

            var menuCustomer = new ToolStripMenuItem();

            menuStrip.Items.Add(menuCustomer);
            menuCustomer.Name = "Customers";
            menuCustomer.Text = "Customers";
            submenu           = new ToolStripMenuItem();
            submenu.Name      = "Add";
            submenu.Text      = "Add";
            submenu.Click    += delegate(Object o, EventArgs e)
            {
                CustomerForm customerForm = new CustomerForm();
                customerForm.Size = new System.Drawing.Size(460, 500);
                customerForm.Font = new Font(customerForm.Font.Name, customerForm.Font.Size + 1, customerForm.Font.Style);
                customerForm.Show();
            };
            menuCustomer.DropDownItems.Add(submenu);
            submenu        = new ToolStripMenuItem();
            submenu.Name   = "View";
            submenu.Text   = "View";
            submenu.Click += delegate(Object o, EventArgs e)
            {
                ViewCustomer viewCustomer = new ViewCustomer();
                viewCustomer.Size = new System.Drawing.Size(1300, 700);
                viewCustomer.Show();
            };
            menuCustomer.DropDownItems.Add(submenu);

            var menuInvoice = new ToolStripMenuItem();

            menuStrip.Items.Add(menuInvoice);
            menuInvoice.Name = "CreateInvoice";
            menuInvoice.Text = "CreateInvoice";
            submenu          = new ToolStripMenuItem();
            submenu.Name     = "New";
            submenu.Text     = "New";
            submenu.Click   += delegate(Object o, EventArgs e)
            {
                SelectCustomer selectCustomer = new SelectCustomer();
                selectCustomer.Size = new System.Drawing.Size(1300, 700);
                selectCustomer.Show();
            };
            menuInvoice.DropDownItems.Add(submenu);

            var menuNotes = new ToolStripMenuItem();

            menuStrip.Items.Add(menuNotes);
            menuNotes.Name = "InvoiceNote";
            menuNotes.Text = "InvoiceNote";
            submenu        = new ToolStripMenuItem();
            submenu.Name   = "Update";
            submenu.Text   = "Update";
            submenu.Click += delegate(Object o, EventArgs e)
            {
                InvoiceNoteForm invoiceNoteForm = new InvoiceNoteForm();
                invoiceNoteForm.Size = new System.Drawing.Size(300, 130);
                invoiceNoteForm.Show();
            };
            menuNotes.DropDownItems.Add(submenu);
            this.Controls.Add(menuStrip);
        }