private void button1_Click(object sender, EventArgs e) { if (searchType.Text != "" && filter.Text != "") { List <Order.Order> searchResult = new List <Order.Order>(); switch (searchType.Text) { case "订单号": searchResult = orderService.SelectOrder(1, filter.Text).ToList(); break; case "商品名": searchResult = orderService.SelectOrder(2, filter.Text).ToList(); break; case "收货人": searchResult = orderService.SelectOrder(3, filter.Text).ToList(); break; case "总价": double total; double.TryParse(filter.Text, out total); searchResult = orderService.SelectOrder(4, total.ToString()).ToList(); break; } orderBindingSource.DataSource = searchResult; } }
private void button1_Click(object sender, EventArgs e) { if (searchType.Text != "" && filter.Text != "") { List <Order.Order> searchResult = new List <Order.Order>(); switch (searchType.Text) { case "订单号": searchResult = orderService.SelectOrder(1, filter.Text); break; case "商品名": searchResult = orderService.SelectOrder(2, filter.Text); break; case "收货人": searchResult = orderService.SelectOrder(3, filter.Text); break; } orderBindingSource.DataSource = searchResult; } }