예제 #1
0
        static void Main(string[] args)
        {
            OrderService orderService = new OrderService();

            orderService.AddOrder("001");
            orderService.AddOrder("002");
            orderService.AddOrder("003");
            orderService.AddOrder("004");
            orderService.AddOrder("005");
            //删除订单
            try
            {
                orderService.DelOrder("002");
                orderService.DelOrder("004");
                orderService.DelOrder("003");
                orderService.DelOrder("006");  //出现异常
            }
            catch (MyException e)
            {
                Console.WriteLine("删除订单失败,出错种类" + e.getId());
            }

            //修改订单
            try
            {
                orderService.ModOrder("003");
                orderService.ModOrder("005");
                orderService.ModOrder("006");   //出现异常
            }
            catch (MyException e)
            {
                Console.WriteLine("修改订单失败,出错种类" + e.getId());
            }

            orderService.FindOrderByNums("005");
            orderService.FindOrderByName("Vermouth");
            orderService.FindOrderByGoods("goodsA");
            orderService.FindOrderByTotalPrice();

            Console.ReadKey();
        }