private void simpleButton1_Click(object sender, EventArgs e) { try { if (ValidateData() == true) { ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO(); //Add du lieu cho BookingH BookingHs aBookingHs = new BookingHs(); aBookingHs.ID = IDBookingH; aBookingHs.Subject = txtSubject.Text; aBookingHs.CreatedDate = this.aBookingHs.CreatedDate; aBookingHs.CustomerType = this.aBookingHs.CustomerType; aBookingHs.BookingType = Convert.ToInt16(lueBookingType.EditValue); aBookingHs.Note = txtNote.Text; aBookingHs.IDGuest = Convert.ToInt16(lueGuest.EditValue); if (txtBookingMoney.Text == "") { aBookingHs.BookingMoney = 0; lueStatusPay.EditValue = CORE.CONSTANTS.SelectedStatusPay(1).ID; } else { aBookingHs.BookingMoney = Convert.ToDecimal(txtBookingMoney.Text); lueStatusPay.EditValue = CORE.CONSTANTS.SelectedStatusPay(2).ID; } aBookingHs.StatusPay = Convert.ToInt16(lueStatusPay.EditValue); aBookingHs.Status = Convert.ToInt16(lueBookingStatus.EditValue); aBookingHs.PayMenthod = 1; if (cbbType.Text == "Tiệc không thuộc phạm trù nhà bếp") { aBookingHs.Type = 1; } else { aBookingHs.Type = 2; } aBookingHs.Disable = false; aBookingHs.Level = Convert.ToInt16(lueLevel.EditValue); aBookingHs.Description = ""; aBookingHs.IDCustomer = Convert.ToInt16(lueCustomer.EditValue); aBookingHs.IDCustomerGroup = Convert.ToInt16(lueCustomerGroup.EditValue); aBookingHs.IDSystemUser = 1;// Để tạm //Add du lieu cho BookingHall List<BookingHalls> aListBookingHall = new List<BookingHalls>(); BookingHalls aTemp; for (int i = 0; i < aListSelected.Count; i++) { aTemp = new BookingHalls(); aTemp.CodeHall = aListSelected[i].Code; aTemp.Cost = aListSelected[i].Cost; aTemp.PercentTax = 10; aTemp.CostRef_Halls = aListSelected[i].CostRef; aTemp.Date = dtpFrom.DateTime; IFormatProvider theCultureInfo = new System.Globalization.CultureInfo("en-GB", true); //DateTime Lunardate = DateTime.ParseExact(LunarDateExt.ToLunarDate(dtpFrom.DateTime, 7).ToString(), "dd/MM/yyyy", theCultureInfo); //aTemp.LunarDate = Lunardate; aTemp.BookingStatus = null; aTemp.Unit = aListSelected[i].Unit; aTemp.TableOrPerson = aListSelected[i].TableOrPerson; aTemp.Note = ""; aTemp.Status = Convert.ToInt16(lueBookingStatus.EditValue); aTemp.StartTime = !string.IsNullOrEmpty(tedStart.Time.ToString()) ? tedStart.Time.TimeOfDay : TimeSpan.Zero; aTemp.EndTime = !string.IsNullOrEmpty(tedEnd.Time.ToString()) ? tedEnd.Time.TimeOfDay : TimeSpan.Zero; aListBookingHall.Add(aTemp); } aReceptionTaskBO.UpdateCheckIn(aBookingHs, aListBookingHall); if (afrmTsk_ManageBookingHs != null) { afrmTsk_ManageBookingHs.ReloadData(); } else if (afrmMain_Halls != null) { afrmMain_Halls.ReloadData(); } MessageBox.Show("Đặt hội trường thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } } catch (Exception ex) { MessageBox.Show("frmTsk_UpdBooking.CheckIn\n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }