public frmIns_BookingHalls_Services(frmTsk_Payment_Step2 afrmTsk_Payment_Step2 ,int IDBookingHall,NewPaymentEN aNewPayment)
 {
     InitializeComponent();
     this.afrmTsk_Payment_Step2 = afrmTsk_Payment_Step2;
     this.IDBookingHall = IDBookingHall;
     this.aNewPayment = aNewPayment;
 }
 // Ngoc
 public frmUpd_Customers_2(frmTsk_Payment_Step2 afrmTsk_Payment_Step2, int IDBookingRoom, int IDCustomer)
 {
     InitializeComponent();
     this.afrmTsk_Payment_Step2 = afrmTsk_Payment_Step2;
     this.IDBookingRoom = IDBookingRoom;
     this.IDCustomer = IDCustomer;
 }
 // Truyền thêm đối số NewPayment để khi thêm dịch vụ từ form Payment sẽ load lại số dịch vụ đã thêm, các thông số còn lại vẫn để nguyên vì chưa chỉnh sửa hết được)
 public frmTsk_UseServices(frmTsk_Payment_Step2 afrmTsk_Payment_Step2, string CodeRoom, int IDBookingRs, int IDBookingRoom, NewPaymentEN aNewPayment)
 {
     InitializeComponent();
     this.afrmTsk_Payment_Step2 = afrmTsk_Payment_Step2;
     this.CodeCurrentRoom = CodeRoom;
     this.IDBookingRs = IDBookingRs;
     this.IDBookingRoom = IDBookingRoom;
     this.aNewPayment = aNewPayment;
 }
        public frmTsk_BookingHall_Customer_New(frmTsk_Payment_Step2 afrmTsk_Payment_Step2, int? IDBookingR, int? IDCompany, int? IDCustomer, int? CustomerType)
        {
            InitializeComponent();
            this.afrmTsk_Payment_Step2 = afrmTsk_Payment_Step2;
            this.IDBookingR = Convert.ToInt32(IDBookingR);
            this.IDCompany = Convert.ToInt32(IDCompany);

            this.IDCustomer = Convert.ToInt32(IDCustomer);
            this.CustomerType = Convert.ToInt32(CustomerType);
        }
        private void btnDetailBookingR_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            try
            {
                int IDBookigR = Convert.ToInt32(viewOwePay.GetFocusedRowCellValue("IDBookingR"));
                int IDBookigH = Convert.ToInt32(viewOwePay.GetFocusedRowCellValue("IDBookingH"));
                int Status = Convert.ToInt32(viewOwePay.GetFocusedRowCellValue("BookingRooms_Status"));

                frmTsk_Payment_Step2 afrmTsk_Payment_Goverment_Step2 = new frmTsk_Payment_Step2(this, IDBookigR, IDBookigH, Status, true);
                afrmTsk_Payment_Goverment_Step2.ShowDialog();

            }
            catch (Exception ex)
            {
                MessageBox.Show("btnDetailBookingR.ButtonClick \n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public frmTsk_SplitBill_Step1(frmTsk_Payment_Step2 afrmTsk_Payment_Step2, NewPaymentEN aNewPaymentEN)
 {
     InitializeComponent();
     this.afrmTsk_Payment_Step2 = afrmTsk_Payment_Step2;
     this.aNewPaymentEN = aNewPaymentEN;
 }
 public frmUpd_Customers(frmTsk_Payment_Step2 afrmTsk_Payment_Step2, int aIDCustomer)
 {
     InitializeComponent();
     this.afrmTsk_Payment_Step2 = afrmTsk_Payment_Step2;
     this.IDCustomer = aIDCustomer;
 }
        private void btnPaymentInfo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            int IDBookingR = Convert.ToInt32(grvPaymentViewAll.GetFocusedRowCellValue("BookingRs_ID"));
            string ObjectType = grvPaymentViewAll.GetFocusedRowCellValue("ObjectType").ToString();
            bool IsFocusTab1 = true;
            if (ObjectType == "Phòng")
            {
                IsFocusTab1 = true;
            }
            else
            {
                IsFocusTab1 = false;
            }

            BookingRs_BookingHsBO aBookingRs_BookingHsBO = new BookingRs_BookingHsBO();
            int IDBookingH = 0;
            if (aBookingRs_BookingHsBO.Select_ByIDBookingR(IDBookingR) == null)
            {
                IDBookingH = 0;
            }
            else
            {
                IDBookingH = Convert.ToInt32(aBookingRs_BookingHsBO.Select_ByIDBookingR(IDBookingR).IDBookingH);
            }

            List<int?> ListStatus = aListPaymentExt_GetAllDataEN.Where(p => p.BookingRs_ID == IDBookingR).Select(p => p.BillR_PaymentStatus).ToList();

            frmTsk_Payment_Step2 afrmTsk_Payment_Step2 = new frmTsk_Payment_Step2(this, IDBookingR, IDBookingH, ListStatus[0].GetValueOrDefault(0), IsFocusTab1);
            afrmTsk_Payment_Step2.ShowDialog();
        }
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.ValidateData() == true)
                {
                    ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO();
                    //Add du lieu cho BookingH
                    BookingHs aBookingHs = new BookingHs();
                    aBookingHs.Subject = txtSubject.Text;
                    aBookingHs.CreatedDate = DateTime.Now;
                    aBookingHs.CustomerType = 3;
                    aBookingHs.BookingType = Convert.ToInt32(lueBookingType.EditValue);
                    aBookingHs.Note = txtNote.Text;
                    aBookingHs.IDGuest = Convert.ToInt32(lueGuest.EditValue);
                    if (txtBookingMoney.Text == "")
                    {
                        aBookingHs.BookingMoney = 0;
                        lueStatusPay.EditValue = CORE.CONSTANTS.SelectedStatusPay(1).ID;
                    }
                    else
                    {
                        aBookingHs.BookingMoney = aBookingHs.BookingMoney = Convert.ToDecimal(txtBookingMoney.Text);
                        lueStatusPay.EditValue = CORE.CONSTANTS.SelectedStatusPay(2).ID;
                    }

                    aBookingHs.StatusPay = Convert.ToInt32(lueStatusPay.EditValue);
                    aBookingHs.Status = Convert.ToInt32(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.Description = "";
                    aBookingHs.IDCustomer = Convert.ToInt32(lueCustomer.EditValue);
                    aBookingHs.IDCustomerGroup = Convert.ToInt32(lueCustomerGroup.EditValue);
                    aBookingHs.IDSystemUser = CORE.CURRENTUSER.SystemUser.ID;

                    //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 = DateTime.Now;
                        IFormatProvider theCultureInfo = new System.Globalization.CultureInfo("en-GB", true);
                        DateTime Lunardate = DateTime.ParseExact(Convert.ToString(LunarDateExt.ToLunarDate(DateTime.Now, 7)),"d/M/yyyy", theCultureInfo);
                        aTemp.LunarDate = Lunardate;
                        aTemp.BookingStatus = null;
                        aTemp.Unit = aListSelected[i].Unit;
                        aTemp.TableOrPerson = aListSelected[i].TableOrPerson;
                        aTemp.Note = "";
                        aTemp.Status = Convert.ToInt32(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);
                    }
                    this.IDBookingH = aReceptionTaskBO.CheckIn(aBookingHs, aListBookingHall);

                    //Hiennv
                    if(this.IDBookingR > 0)
                    {
                        BookingRs_BookingHsBO aBookingRs_BookingHsBO = new BookingRs_BookingHsBO();

                        BookingRs_BookingHs aBookingRs_BookingHs = new BookingRs_BookingHs();
                        aBookingRs_BookingHs.IDBookingR = this.IDBookingR;
                        aBookingRs_BookingHs.IDBookingH = this.IDBookingH;
                        aBookingRs_BookingHs.Type = String.Empty;
                        aBookingRs_BookingHs.Status = String.Empty;
                        aBookingRs_BookingHs.Disable = false;
                        aBookingRs_BookingHs.Extension1 = String.Empty;
                        aBookingRs_BookingHs.Extension2 = String.Empty;
                        aBookingRs_BookingHs.Extension3 = String.Empty;

                        aBookingRs_BookingHsBO.Insert(aBookingRs_BookingHs);

                    }

                    MessageBox.Show("Đặt hội trường thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    DialogResult result = MessageBox.Show("Bạn có thêm dịch vụ cho hội trường " + aBookingHs.Subject + " này không?", "Thêm dịch vụ hội trường", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (result == DialogResult.Yes)
                    {
                        frmTsk_Payment_Step2 afrmTsk_Payment_Step2 = new frmTsk_Payment_Step2(Convert.ToInt32(this.IDBookingR), Convert.ToInt32(this.IDBookingH),2,false);
                        afrmTsk_Payment_Step2.ShowDialog();
                    }
                    if (afrmMain_Halls != null)
                    {
                        this.afrmMain_Halls.Reload();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("frmTsk_BookingHall_Customer.CheckIn\n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnDetailRooms_Click(object sender, EventArgs e)
        {
            try
            {
                BookingRs_BookingHsBO aBookingRs_BookingHsBO = new BookingRs_BookingHsBO();
                BookingRs_BookingHs aBookingRs_BookingHs = aBookingRs_BookingHsBO.Select_ByIDBookingR(Convert.ToInt32(this.Datasource.BookingRs_ID));
                int IDBookingH = 0;
                if(aBookingRs_BookingHs !=null)
                {
                    IDBookingH = Convert.ToInt32(aBookingRs_BookingHs.IDBookingH);
                }
                frmTsk_Payment_Step2 afrmTsk_Payment_Step2 = new frmTsk_Payment_Step2(this.afrmMain,Convert.ToInt32(this.Datasource.BookingRs_ID),IDBookingH,3,true);
                afrmTsk_Payment_Step2.ShowDialog();
                this.Parent.Dispose();

            }
            catch (Exception ex)
            {
                MessageBox.Show("uc_Tooltip_StatusRoom_3.btnDetailRooms_Click\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void btnEditBookingH_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     try
     {
         int IDBookingH = Convert.ToInt32(grvChecked.GetFocusedRowCellValue("ID"));
         BookingRs_BookingHs aBookingRs_BookingHs = (new BookingRs_BookingHsBO()).Select_ByIDBookingH(IDBookingH);
         BookingRs aBookingRs = (new BookingRsBO()).Select_ByID(aBookingRs_BookingHs.IDBookingR.GetValueOrDefault(0));
         //frmTsk_UpdBookingHall afrmTsk_UpdBookingHall = new frmTsk_UpdBookingHall(this, IDBookingH);
         //afrmTsk_UpdBookingHall.ShowDialog();
         frmTsk_Payment_Step2 afrmTsk_Payment_Step2 = new frmTsk_Payment_Step2(aBookingRs_BookingHs.IDBookingR.GetValueOrDefault(0), IDBookingH, aBookingRs.Status.GetValueOrDefault(0), false);
         afrmTsk_Payment_Step2.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmMain_Halls.btnEdit_ButtonClick \n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #12
0
        private void btnDetailBooking_Click(object sender, EventArgs e)
        {
            int BookingRs_ID = Convert.ToInt32(grvBookingRoom.GetFocusedRowCellValue("BookingRs_ID").ToString());

            BookingRs_BookingHsBO aBookingRs_BookingHsBO = new BookingRs_BookingHsBO();
            BookingRs_BookingHs aBookingRs_BookingHs = aBookingRs_BookingHsBO.Select_ByIDBookingR(Convert.ToInt32(BookingRs_ID));
            int IDBookingH = 0;

            if (aBookingRs_BookingHs != null)
            {
                IDBookingH = Convert.ToInt32(aBookingRs_BookingHs.IDBookingH);
            }
            frmTsk_Payment_Step2 afrmTsk_Payment_Step2 = new frmTsk_Payment_Step2(this, Convert.ToInt32(BookingRs_ID), IDBookingH, 3, true);
            afrmTsk_Payment_Step2.ShowDialog();
        }