Ejemplo n.º 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;
            }
        }
Ejemplo n.º 2
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction action = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
            {
                Caption = "友情提示", Description = "是否关闭此应用程序?"
            };
            Predicate <DialogResult> predicate = canCloseFunc;

            DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
            {
                Text = "关闭", Result = System.Windows.Forms.DialogResult.Yes
            };
            DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
            {
                Text = "取消", Result = System.Windows.Forms.DialogResult.No
            };
            DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command3 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
            {
                Text = "重启", Result = System.Windows.Forms.DialogResult.Retry
            };
            DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand command4 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutCommand()
            {
                Text = "切换用户", Result = System.Windows.Forms.DialogResult.Ignore
            };
            action.Commands.Add(command1);
            action.Commands.Add(command2);
            action.Commands.Add(command3);
            action.Commands.Add(command4);
            FlyoutProperties properties = new FlyoutProperties();

            properties.ButtonSize = new Size(100, 40);
            properties.Style      = FlyoutStyle.MessageBox;
            properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            DialogResult result = FlyoutDialog.Show(this, action, properties, predicate);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                this.close = true;
                e.Cancel   = false;
            }
            else if (result == System.Windows.Forms.DialogResult.Retry)
            {
                System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location, "restart");
                System.Environment.Exit(0);
                //this.restart = true;
                //e.Cancel = false;
            }
            else if (result == System.Windows.Forms.DialogResult.Ignore)
            {
                this.changeuser = true;
                e.Cancel        = false;
            }
            else
            {
                e.Cancel = true;
            }
        }
Ejemplo n.º 3
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;
            }
        }
Ejemplo n.º 4
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;
            }
        }
Ejemplo n.º 5
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;
            }
        }
Ejemplo n.º 6
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;
            }
        }