public void RunUserModule() { Console.Clear(); while (option != exitValue) { DisplayUserMenu(); Console.Write("\nChoose an option: "); input = Console.ReadLine(); bool result = Int32.TryParse(input, out option); if (result) { switch (option) { case 1: Console.Clear(); DisplayInventory.ListInventory(); break; case 2: //Console.WriteLine("CREATE new invoice\n"); Console.Clear(); //grandTotal += NewInvoice.CreateNewInvoice(counter++); bool invoiceCreated = NewInvoice.CreateNewInvoice(); if (invoiceCreated) { int invoiceCounter = NewInvoice.GetNumberOfInvoice(); NewInvoice.AddItemToInvoice(invoiceCounter); } break; case 3: //Console.WriteLine("DISPLAY invoice\n"); Console.Clear(); InvoicesReport.DisplayInvoicesReport(); break; case 4: Console.Clear(); Console.WriteLine("EXITING the application... Thank you!"); break; default: Console.Clear(); Console.WriteLine(">>> Invalid input. Please try again!\n"); break; } } else { Console.Clear(); Console.WriteLine(">>> Invalid input. Please try again!\n"); } } }
private void invoicesToolStripMenuItem_Click(object sender, EventArgs e) { Form[] childForms = this.MdiChildren; foreach (Form childForm in childForms) { childForm.Close(); } InvoicesReport invoicesReport = new InvoicesReport(); invoicesReport.StartPosition = FormStartPosition.CenterParent; invoicesReport.MdiParent = this; invoicesReport.Show(); }