Beispiel #1
0
        private void wbntDichvu_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            switch (e.Button.Properties.Tag.ToString())
            {
            case "Thêm nhân viên":
                //Nếu không có loại KH, thông báo cần tạo loại phòng trước

                //if (LoaiKhachHangBUS.LayTatCaLoaiKhachHang_List().Count == 0)
                //{
                //    XtraMessageBox.Show("Cần phải thêm loại khách hàng trước!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //    return;
                //}

                themNhanVien1.Initialize();
                this.NhanVienPagecontrol.SelectedPage = PageThemnhanvien;
                break;

            case "Sửa nhân viên":
                //suaKhachHang3.RefreshDataBinding((int)khachHang.Rows[gridView1.GetFocusedDataSourceRowIndex()]["MaKH"]);
                suaNhanVien1.RefreshDataBinding((int)nhanVien.Rows[gridView1.GetFocusedDataSourceRowIndex()]["MaNhanVien"]);

                this.NhanVienPagecontrol.SelectedPage = PageSuanhanvien;
                break;

            case "Bộ Lọc":
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
                {
                    Caption = "BỘ LỌC", Description = "Close the application?"
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Lọc", Result = System.Windows.Forms.DialogResult.Yes
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Hủy", Result = System.Windows.Forms.DialogResult.No
                };
                action.Commands.Add(command1);
                action.Commands.Add(command2);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(160, 50);
                properties.Style      = FlyoutStyle.MessageBox;

                filterDialog = new FilterControlDialog(gridControl1, gridView1.ActiveFilterString.ToString());

                if (DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), filterDialog, action, properties) == DialogResult.Yes)
                {
                    if (filterDialog.GetFilterString() == "")
                    {
                        return;
                    }

                    gridView1.ActiveFilterString = strFilterDialog = filterDialog.GetFilterString();
                }
                break;
            }
        }
Beispiel #2
0
        private void windowsUIButtonPanel1_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            switch (e.Button.Properties.Tag.ToString())
            {
            case "Đặt Phòng":
                DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), new folderTinhTrangPhong.DatPhong(OnDatPhongSuccess));

                break;

            case "Chi Tiết Đặt Phòng":

                (this.ParentForm as MainForm).HienThiThongTinDatPhong((int)dtDatPhong.Rows[gridViewDatPhong.GetFocusedDataSourceRowIndex()]["MaDatPhong"]);

                break;

            case "Hiển Thị Dạng Biểu Đồ":
                navigationFrame1.SelectedPage = navigationPage1;
                break;

            case "Bộ Lọc":
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
                {
                    Caption = "BỘ LỌC", Description = "Close the application?"
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Lọc", Result = System.Windows.Forms.DialogResult.Yes
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Hủy", Result = System.Windows.Forms.DialogResult.No
                };
                action.Commands.Add(command1);
                action.Commands.Add(command2);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(160, 50);
                properties.Style      = FlyoutStyle.MessageBox;

                filterDialog = new FilterControlDialog(gridControl1, gridViewDatPhong.ActiveFilterString.ToString());

                if (DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), filterDialog, action, properties) == DialogResult.Yes)
                {
                    if (filterDialog.GetFilterString() == "")
                    {
                        return;
                    }

                    gridViewDatPhong.ActiveFilterString = strFilterDialog = filterDialog.GetFilterString();
                }

                break;
            }
        }
Beispiel #3
0
        private void wbntHoadon_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            switch (e.Button.Properties.Tag.ToString())
            {
            case "Xem Hóa Đơn":
                DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(typeof(WaitForm1));
                if (dtHoaDon.Rows[gridViewHoaDon.GetFocusedDataSourceRowIndex()]["TongTienThanhToan"].ToString() != "")
                {
                    thanhToan1.RefreshDataBinding_ReadOnly(HoaDonBUS.LayThongTinHoaDon((int)dtHoaDon.Rows[gridViewHoaDon.GetFocusedDataSourceRowIndex()]["MaHoaDon"]));
                }
                else
                {
                    thanhToan1.RefreshDataBinding(HoaDonBUS.LayTatCaCacThuePhong((int)dtHoaDon.Rows[gridViewHoaDon.GetFocusedDataSourceRowIndex()]["MaHoaDon"])[0]);
                }
                DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm();
                navigationFrame1.SelectedPage = navigationPage2;
                break;

            case "Bộ Lọc":
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
                {
                    Caption = "BỘ LỌC", Description = "Close the application?"
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Lọc", Result = System.Windows.Forms.DialogResult.Yes
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Hủy", Result = System.Windows.Forms.DialogResult.No
                };
                action.Commands.Add(command1);
                action.Commands.Add(command2);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(160, 50);
                properties.Style      = FlyoutStyle.MessageBox;

                filterDialog = new FilterControlDialog(GridControlHoaDon, gridViewHoaDon.ActiveFilterString.ToString());

                if (DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), filterDialog, action, properties) == DialogResult.Yes)
                {
                    if (filterDialog.GetFilterString() == "")
                    {
                        return;
                    }

                    gridViewHoaDon.ActiveFilterString = strFilterDialog = filterDialog.GetFilterString();
                }
                break;
            }
        }
Beispiel #4
0
        private void wbntDichvu_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            switch (e.Button.Properties.Tag.ToString())
            {
            case "Thêm Dịch Vụ":


                //Nếu không có loại dv, thông báo cần tạo loại phòng trước
                if (LoaiDichVuBUS.LayTatCaLoaiDichVu_List().Count == 0)
                {
                    XtraMessageBox.Show("Cần phải thêm loại dịch vụ trước!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                themDichVu1.Initialize();
                this.DichVuPagecontrol.SelectedPage = PageThemdichvu;
                break;

            case "Sửa Dịch Vụ":
                suaDichVu1.RefreshDataBinding((int)dichVu.Rows[gridView1.GetFocusedDataSourceRowIndex()]["MaDV"]);
                this.DichVuPagecontrol.SelectedPage = PageSuadichvu;
                break;

            case "Quản Lý Loại Dịch Vụ":
                goToQuanLyDichVu();
                break;

            case "Bộ Lọc":
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
                {
                    Caption = "BỘ LỌC", Description = "Close the application?"
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Lọc", Result = System.Windows.Forms.DialogResult.Yes
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Hủy", Result = System.Windows.Forms.DialogResult.No
                };
                action.Commands.Add(command1);
                action.Commands.Add(command2);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(160, 50);
                properties.Style      = FlyoutStyle.MessageBox;

                filterDialog = new FilterControlDialog(gridControl1, gridView1.ActiveFilterString.ToString());

                if (DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), filterDialog, action, properties) == DialogResult.Yes)
                {
                    if (filterDialog.GetFilterString() == "")
                    {
                        return;
                    }

                    gridView1.ActiveFilterString = strFilterDialog = filterDialog.GetFilterString();
                    tileControl2.SelectedItem    = tileFilter;
                    tileFilter.Visible           = true;
                }



                //DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), new FilterControlDialog(gridControl1), properties);
                break;
            }
        }
Beispiel #5
0
        private void wbntKhachhang_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            switch (e.Button.Properties.Tag.ToString())
            {
            case "Thêm khách hàng":
                //Nếu không có loại KH, thông báo cần tạo loại phòng trước
                if (LoaiKhachHangBUS.LayTatCaLoaiKhachHang_List().Count == 0)
                {
                    XtraMessageBox.Show("Cần phải thêm loại khách hàng trước!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                themKhachHang3.Initialize();
                this.KhachhangPagecontrol.SelectedPage = PageThemkhachhang;
                break;

            case "Sửa khách hàng":
                suaKhachHang3.RefreshDataBinding((int)khachHang.Rows[gridView1.GetFocusedDataSourceRowIndex()]["MaKH"]);
                this.KhachhangPagecontrol.SelectedPage = PageSuakhachang;
                break;

            case "Bộ lọc":
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
                {
                    Caption = "BỘ LỌC", Description = "Close the application?"
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Lọc", Result = System.Windows.Forms.DialogResult.Yes
                };
                DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
                {
                    Text = "Hủy", Result = System.Windows.Forms.DialogResult.No
                };
                action.Commands.Add(command1);
                action.Commands.Add(command2);
                FlyoutProperties properties = new FlyoutProperties();
                properties.ButtonSize = new Size(160, 50);
                properties.Style      = FlyoutStyle.MessageBox;

                filterDialog = new FilterControlDialog(gridControl1, gridView1.ActiveFilterString.ToString());

                if (DevExpress.XtraBars.Docking2010.Customization.FlyoutDialog.Show(this.FindForm(), filterDialog, action, properties) == DialogResult.Yes)
                {
                    if (filterDialog.GetFilterString() == "")
                    {
                        return;
                    }

                    gridView1.ActiveFilterString = strFilterDialog = filterDialog.GetFilterString();
                    tileControl2.SelectedItem    = tileFilter;
                    tileFilter.Visible           = true;
                }


                break;

            case "Quản lý loại khách hàng":
                goToLoaiKhachHang();
                break;
                //case "Xóa":
                //    //Thông báo xác nhận
                //    if (XtraMessageBox.Show("Bạn có chắc xóa khách hàng '" + gridView1.GetFocusedRowCellValue(colTenKH).ToString() + "' ?", "Xác nhận", MessageBoxButtons.OKCancel) == DialogResult.OK)
                //    {

                //        if (BUS.KhachHangBUS.XoaKhachHang((int)gridView1.GetFocusedRowCellValue(colMaKH)))
                //        {

                //            //Thông báo thành công/thất bại
                //            XtraMessageBox.Show("Xóa khách hàng thành công!", "Thông báo", MessageBoxButtons.OK);
                //            RefreshDataBinding();
                //        }
                //        else
                //            //Thông báo thành công/thất bại
                //            XtraMessageBox.Show("Xóa khách hàng thất bại!", "Thông báo", MessageBoxButtons.OK);
                //    }
                //    break;
            }
        }