示例#1
0
        static void Main()
        {
            OrderDetails FirstOrder  = new OrderDetails(01, "JX1", "一点点", 1, 1.5);        //初始化订单
            OrderDetails SecondOrder = new OrderDetails(02, "JX2", "两点点", 2, 2.5);
            OrderDetails ThirdOrder  = new OrderDetails(03, "JX3", "三点点", 3, 3.5);
            OrderDetails FourthOrder = new OrderDetails(04, "JX4", "四点点", 4, 4.5);


            OrderService Oporder = new OrderService();

            Oporder.AddOrder(FirstOrder);                     //添加订单
            Oporder.AddOrder(SecondOrder);
            Oporder.AddOrder(ThirdOrder);
            Oporder.AddOrder(FourthOrder);

            Oporder.DeleteOrder(06);                         //删除指定订单


            Oporder.ChangeOrder("JX1", 5);                //修改商品数量

            Oporder.LookForOrder("一点点");                  //查找指定订单

            for (int i = 0; i < Oporder.OrderList.Count; i++)
            {
                Console.Write(" 商品名称是: " + Oporder.OrderList[i].GoodsName + " 商品数量是: " + Oporder.OrderList[i].GoodsNumber + " 商品价格是: " + Oporder.OrderList[i].GoodsPrice);
                Console.WriteLine();
            }

            Console.WriteLine();
        }