private void button1_Click(object sender, EventArgs e) { try { cilent NewClient = new cilent(); if (textBox_clientId.TextLength == 0 || textBox_clientName.TextLength == 0 || textBox_orderId.TextLength == 0) { MessageBox.Show("输入不能为空"); } else { NewClient.cilentId = uint.Parse(textBox_clientId.Text); NewClient.cilentName = textBox_clientName.Text; order tmp = formProgram.orderWin.addOrder(uint.Parse(textBox_orderId.Text), NewClient); InputForm form4 = new InputForm(); form4.getOrder(tmp); form4.ShowDialog(); orderDetail newDetail = form4.returnObject(); tmp.addDetail(newDetail); tmp.calculate(); Form1.orderBindingSource.Add(tmp); Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }