示例#1
0
        static void Main(string[] args)
        {
            Mobike m1 = new Mobike();
            int    i  = 8;

            while (i == 8)
            {
                Console.WriteLine("Press 1  Insert The Data");
                Console.WriteLine("Press 2  Display Data");
                Console.WriteLine("Press 3 Search Data");
                Console.WriteLine("Press 4 Delete The Recored");
                Console.WriteLine("Press 5 Edit The Record");
                int ch = Convert.ToInt32(Console.ReadLine());
                switch (ch)
                {
                case 1:
                    m1.input();
                    Console.WriteLine("===SuccessFull  Added The Data======");

                    break;

                case 2:
                    m1.Display();
                    break;

                case 3:
                    m1.SearchCustomer();
                    break;

                case 4:
                    m1.deletedata();
                    Console.WriteLine("===SuccessFull  Deleted The Data======");
                    break;

                case 5:
                    m1.editdata();
                    Console.WriteLine("===SuccessFull  Edited The Data======");
                    break;

                default:
                    Console.WriteLine("invalid Choise");
                    break;
                }

                Console.WriteLine();
                Console.WriteLine("===========================================");
                Console.WriteLine("Do you Want TO Continue Then Press 8");
                i = Convert.ToInt32(Console.ReadLine());
            }
        }
        static void Main(string[] args)
        {
            Mobike mb     = new Mobike();
            char   choice = 'y';

            while (choice == 'y')
            {
                Console.WriteLine("Enter your choice :");
                Console.WriteLine("Press 1)Add 2)Remove 3)Edit 4)Search 5)Display");
                int ch = Convert.ToInt32(Console.ReadLine());
                switch (ch)
                {
                case 1:
                    mb.Input();
                    mb.Display();
                    break;

                case 2:
                    mb.Delete();
                    break;

                case 3:
                    mb.Edit();
                    mb.Display();
                    break;

                case 4:
                    mb.Search();
                    break;

                case 5:
                    mb.Display();
                    break;

                default:
                    Console.WriteLine("Invalid choice!");
                    break;
                }
                Console.WriteLine("If you want to continue? (y/n)");
                choice = Convert.ToChar(Console.ReadLine());
            }

            Console.ReadKey();
        }