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); }
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); } }
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); }
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(); } }
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); }
public bool AddOrder(OrderDetatils order) { list.Add(order); return(true); }
public Errores(OrderDetatils order) { this.order = order; }