Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            NewOrder newOrder = new NewOrder();

            newOrder.ShowDialog();
            OrderDetatils order = new OrderDetatils
            {
                OrderNumber   = OrderService.list.Count + 1,
                OrderQuantity = newOrder.od.OrderQuantity,
                ProductName   = newOrder.od.ProductName,
                Client        = newOrder.od.Client
            };

            _orderService.AddOrder(order);
        }
Esempio n. 2
0
        private void button2_Click(object sender, EventArgs e) //新增订单
        {
            NewOrderOne newOrder = new NewOrderOne();

            newOrder.ShowDialog();
            if (newOrder.OK)
            {
                OrderDetatils order = new OrderDetatils
                {
                    OrderNumber   = Order.NumToString(OrderService.list.Count + 1),
                    OrderQuantity = newOrder.od.OrderQuantity,
                    ProductName   = newOrder.od.ProductName,
                    Client        = newOrder.od.Client
                };
                _orderService.AddOrder(order);
            }
        }
Esempio n. 3
0
        public bool AddOrder(int i)                                     //随机生成一个订单,依据传入的int数据自动生成各项信息
        {
            OrderDetatils orderDetatils = new OrderDetatils();

            try
            {
                orderDetatils.OrderNumber   = i;
                orderDetatils.OrderQuantity = i * i + i * i * i + i * i * i * i;
                orderDetatils.ProductName   = GenerateCheckCode(i);
                orderDetatils.Client        = GenerateCheckCode(i * i + 1);
                list.Add(orderDetatils);
            }
            catch
            {
                Console.WriteLine("The date you entered is invaild!!!");
            }
            return(true);
        }
Esempio n. 4
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         OK     = true;
         Num    = int.Parse(this.textBox1.Text);
         cOrder = new OrderDetatils
         {
             OrderNumber   = Order.NumToString(Num),
             OrderQuantity = int.Parse(this.textBox2.Text),
             ProductName   = this.textBox3.Text,
             Client        = this.textBox4.Text
         };
     }
     catch (Exception ex)
     {
         ErrorScene errorScene = new ErrorScene();
         errorScene.ShowDialog();
     }
 }
Esempio n. 5
0
        public static List <OrderDetatils> list = new List <OrderDetatils>();  //list用来存储订单

        public bool AddOrder()                                                 //生成一个订单,手动输入订单的各项信息
        {
            OrderDetatils orderDetatils = new OrderDetatils();

            try
            {
                Console.WriteLine("Please enter the order number:");
                orderDetatils.OrderNumber = int.Parse(Console.ReadLine());
                Console.WriteLine("Please enter the order quantity:");
                orderDetatils.OrderQuantity = int.Parse(Console.ReadLine());
                Console.WriteLine("Please enter the product name:");
                orderDetatils.ProductName = Console.ReadLine();
                Console.WriteLine("Please enter the client name:");
                orderDetatils.Client = Console.ReadLine();
                list.Add(orderDetatils);
            }
            catch
            {
                Console.WriteLine("The date you entered is invaild!!!");
                return(false);
            }
            return(true);
        }
Esempio n. 6
0
 public bool AddOrder(OrderDetatils order)
 {
     list.Add(order);
     return(true);
 }
Esempio n. 7
0
 public Errores(OrderDetatils order)
 {
     this.order = order;
 }