private void button1_Click(object sender, EventArgs e) { if (textBox1.Text.Length == 0 || textBox2.Text.Length == 0 || textBox3.Text.Length == 0) { MessageBox.Show("请填写完整信息", "提示"); } else { ec.Name = textBox1.Text; ec.Address = textBox2.Text; ec.Phoneno = textBox3.Text; BLL.BLL bc = new BLL.BLL(); int count = Convert.ToInt32(bc.AddCustomer(ec)); if (count == 0) { AddBoat ab = new AddBoat(); ab.ec = this.ec; this.Hide(); ab.ShowDialog(); this.Show(); } else { MessageBox.Show("用户名已被占用", "提示"); } } }