コード例 #1
0
        private void btnBooking_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.ValidateData() == true)
                {
                    aBookingEN.Subject = txtSubject.Text;
                    aBookingEN.Level = Convert.ToInt32(lueLevel.EditValue);
                    aBookingEN.Description = txaDescription.Text;
                    aBookingEN.Note = txaNote.Text;
                    aBookingEN.IDCustomerGroup = Convert.ToInt32(lueIDCustomerGroups.EditValue.ToString());
                    aBookingEN.IDCustomer = Convert.ToInt32(lueIDCustomers.EditValue.ToString());

                    aBookingEN.CustomerType = cboCustomerType.SelectedIndex + 1;  // 1: Khach nha nuoc, 2: Khach doan, 3: khach le,
                    aBookingEN.BookingType = 3;   // 1: Dat onlie, 2: Dat qua dien thoai, 3: Truc tiep, 4: Cong van
                    aBookingEN.IDSystemUser = CORE.CURRENTUSER.SystemUser.ID;
                    aBookingEN.PayMenthod = 1;     //1:Tien mat
                    aBookingEN.StatusPay = 1;      //1:Chua thanh toan
                    aBookingEN.ExchangeRate = 0;
                    aBookingEN.Status = 2; // 2 : Checked
                    aBookingEN.Type = -1;
                    aBookingEN.Disable = false;

                    ReceptionTaskBO aCheckInActionBO = new ReceptionTaskBO();
                    aCheckInActionBO.Booking(aBookingEN);
                    MessageBox.Show("Đặt phòng thành công .", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    this.afrmTsk_Booking_Step1.Close();
                    if (this.afrmTsk_Booking_Step1.afrmMain != null)
                    {
                        this.afrmTsk_Booking_Step1.afrmMain.ReloadData();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("frmTsk_Booking_Step2.btnBooking_Click\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }