public void Describe(string memberName, string roomNumber, AgvMap myParam) { System.Windows.Forms.MessageBox.Show(String.Format("尊敬的会员{0},恭喜您预定房间{1}成功!", memberName, roomNumber), "提示"); //此处故意报错 throw new Exception("我就错了,咋地"); }
private void btn_Subscribe_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(tb_MemberName.Text.Trim()) && !String.IsNullOrEmpty(tb_Room.Text.Trim())) { AgvMap myParam = new AgvMap() { agvCode = "111", agvNumber = "222", rfid = "555" }; new CoreBusiness().Describe(tb_MemberName.Text.Trim(), tb_Room.Text.Trim(), myParam); } else { MessageBox.Show("信息不完整", "提示"); } }