Ejemplo n.º 1
0
        public void display()
        {
            do
            {
                Console.WriteLine("\nWhich Operation you need to perform\n1.Display\n2.Search\n3.Exit\nEnter your choice");
                int opt = int.Parse(Console.ReadLine());
                switch (opt)
                {
                case 1:
                    ib.DisplayProducts();
                    break;

                case 2:
                    ib.Search();
                    break;
                }
                Console.WriteLine("Do u want to see operations again ?Press 1");
                prs1 = int.Parse(Console.ReadLine());
            } while (prs1 == 1);
        }
Ejemplo n.º 2
0
        public void Display()
        {
            Console.WriteLine("Menu 1.Display 2.Search 3.Exit \n enter your choice");
            int op = int.Parse(Console.ReadLine());

            switch (op)
            {
            case 1:
                ib.DisplayProducts();
                break;

            case 2:
                ib.Search();
                break;
            }
        }
Ejemplo n.º 3
0
        public void show()
        {
            int c, n;

            do
            {
                Console.WriteLine("menu 1.Add items\n 2.Search items \n 3.See items \n   4.Additemstosub");
                int op = int.Parse(Console.ReadLine());
                switch (op)
                {
                case 1:
                    do
                    {
                        Console.WriteLine("enter category id");
                        int catid = int.Parse(Console.ReadLine());
                        Console.WriteLine("enter category name");
                        string catname = Console.ReadLine();
                        Console.WriteLine("enter subcategory id");
                        int subcid = int.Parse(Console.ReadLine());
                        Console.WriteLine("enter category name");
                        string subcname = Console.ReadLine();

                        Console.WriteLine("enter subcategory description");
                        string subdesc = Console.ReadLine();

                        Console.WriteLine("enter Item id");
                        int itemid = int.Parse(Console.ReadLine());
                        Console.WriteLine("enter Item price");
                        int itemprice = int.Parse(Console.ReadLine());
                        Console.WriteLine("enter Item stocknum");
                        int itemstock = int.Parse(Console.ReadLine());
                        Console.WriteLine("enter item name");
                        string itemname = Console.ReadLine();
                        Console.WriteLine("enter item desc");
                        string itemdesc = Console.ReadLine();
                        Console.WriteLine("enter item remarks");
                        string itemremarks = Console.ReadLine();
                        ib.AddItem(itemid, catid, subcid, itemname, catname, subcname, itemstock, itemprice, itemdesc, itemremarks, subdesc);
                        Console.WriteLine("do you want to continue");
                        c = int.Parse(Console.ReadLine());
                    } while (c == 1);

                    break;

                case 2:
                    ib.Search();
                    break;

                case 3:
                    ib.DisplayProducts();
                    break;

                case 4:

                    Console.WriteLine("enter subcategory id");
                    int asi = int.Parse(Console.ReadLine());
                    ib.Add(asi);

                    break;
                }

                Console.WriteLine("do you want to perform another operation");
                n = int.Parse(Console.ReadLine());
            } while (n == 1);
        }