private void sbCreate_Click(object sender, EventArgs e) { try { if (this.ValidateData() == true) { GuestsBO aGuestsBO = new GuestsBO(); Guests aGuests = new Guests(); aGuests.Name = txtName.Text; aGuests.Nationality = lueNationality.EditValue.ToString(); aGuests.Type = int.Parse(cbbType.Text); aGuests.Info = txtInfo.Text; aGuests.GroupName = txtGroupName.Text; aGuestsBO.Insert(aGuests); if (afrmLst_Guests != null) { afrmLst_Guests.Reload(); } MessageBox.Show("Thêm mới thành công !", "Success ", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } } catch (Exception ex) { MessageBox.Show("frmUpd_Guests.sbCreate_Click\n" + ex.ToString(), "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void sbCreate_Click(object sender, EventArgs e) { try { if (this.ValidateData() == true) { GuestsBO aGuestsBO = new GuestsBO(); Guests aGuests = new Guests(); aGuests.Name = txtName.Text; aGuests.Nationality = lueNationality.EditValue.ToString(); aGuests.Type = int.Parse(cbbType.Text); aGuests.Info = txtInfo.Text; aGuests.GroupName = "Khách mời"; int ID = aGuestsBO.Insert(aGuests); if (afrmLst_Guests != null) { afrmLst_Guests.Reload(); } if (afrmTsk_BookingHall_Goverment != null) { this.afrmTsk_BookingHall_Goverment.ReloadData(); this.afrmTsk_BookingHall_Goverment.CallBackGuest(ID); } if (afrmTsk_BookingHall_Group != null) { this.afrmTsk_BookingHall_Group.ReloadData(); this.afrmTsk_BookingHall_Group.CallBackGuest(ID); } if (afrmTsk_BookingHall_Customer != null) { this.afrmTsk_BookingHall_Customer.ReloadData(); this.afrmTsk_BookingHall_Customer.CallBackGuest(ID); } if (afrmTsk_BookingHall_Customer_New != null) { this.afrmTsk_BookingHall_Customer_New.LoadGuest(); this.afrmTsk_BookingHall_Customer_New.CallBackGuest(ID); } if (afrmTsk_UpdBooking != null) { this.afrmTsk_UpdBooking.ReloadData(); } MessageBox.Show("Thêm mới thành công !", "Success ", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } } catch (Exception ex) { MessageBox.Show("frmIns_Guest.sbCreate_Click\n" + ex.ToString(), "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }