Example #1
0
        static void Main(string[] agrs)
        {
            var now_s = new OrderService();

            now_s.Add("1", "myc");
            now_s.Add("2", "myc");
            now_s.Add("1", "cxy");
            now_s.Add("2", "cxy");
            try
            {
                now_s.findbycustomer("myc")[0].print();
                now_s.Delbyid(3);
                now_s.Delbyid(10);
            }
            catch (Find_abnormal a)
            {
                Console.WriteLine(a.a);
            }
            try
            {
                now_s.findbyname("1")[0].print();
                now_s.findbyid(1).print();
            }
            catch (Find_abnormal a)
            {
                Console.WriteLine(a.a);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            OrderService or = new OrderService();

            while (or.p)
            {
                Console.WriteLine("请输入要进行的操作:");
                string action = Console.ReadLine();
                switch (action)
                {
                case "add":
                    or.Add();
                    break;

                case "delete":
                    or.Delete();
                    break;

                case "scan":
                    or.Scan();
                    break;

                case "break":
                    or.Break();
                    break;

                case "linq":
                    or.Linq();
                    break;
                }
            }
        }
Example #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("--------------------欢迎使用订单管理系统---------------");


            OrderService ServiceExample = new OrderService();

/*            string[] order1 = new string[2]{" 吉米诺维奇数学分析", "饥荒联机版"};
 *          string[] order2 = new string[1] { "圣经选读" };
 *          string[] order3 = new string[1] { "Counter-Strike Global Offensive"};
 *          ServiceExample.AddOrder(1, "李奇伟", order1);
 *          ServiceExample.AddOrder(2, "丛兴柏", order2);
 *        ServiceExample.AddOrder(3, "杜特", order3);
 */
            ServiceExample.OrderList.Sort(new NumberCompare());
            string a = "";

            do
            {
                Console.WriteLine("请选择服务类型:");
                Console.WriteLine("1.新增订单 2.删除订单 3.查询订单 4.修改订单");
                string i = Console.ReadLine();

                switch (i)
                {
                case "1":
                    ServiceExample.Add();
                    break;

                case "2":
                    ServiceExample.DeletOrder();
                    break;

                case "3":
                    ServiceExample.Search();
                    break;

                case "4":
                    ServiceExample.ModifyOrder();
                    break;
                }
                Console.WriteLine("是否继续使用系统?1.是2.否");
                a = Console.ReadLine();
            } while (a == "1");
        }