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; } }
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; } }
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; } }
/// <summary> /// 显示消息 /// </summary> /// <param name="caption">消息标题</param> /// <param name="message">消息内容</param> public void ShowMessage(string caption, string message) { var messageAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction() { Caption = caption, Description = message }; messageAction.Commands.Add(FlyoutCommand.OK); closeAppFlyout.Action = messageAction; mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout); }
private void aboutActionFunction() { var aboutAppAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction() { Caption = "关于", Description = "北斗大坝安全监测系统 V1.0\nCopyright@2012 福建泉州泰克通信设备有限公司" }; aboutAppAction.Commands.Add(FlyoutCommand.OK); closeAppFlyout.Action = aboutAppAction; mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout); }
private void tileNotImplement_Click(object sender, TileClickEventArgs e) { var notImplmentAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction() { Caption = "提示", Description = "该功能正在研发中,敬请期待....." }; notImplmentAction.Commands.Add(FlyoutCommand.OK); closeAppFlyout.Action = notImplmentAction; mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout); e.Handled = true; }
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; } }
/// <summary> /// 显示删除用户确认界面 /// </summary> /// <param name="yh">待删除的用户</param> public void ShowDeleteYHConfirm(Yh yh) { var deleteYHAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction() { Caption = "删除确认", Description = string.Format("确定要删除【{0}】用户吗?", yh.Xm) }; deleteYHAction.Commands.Add(FlyoutCommand.Yes); deleteYHAction.Commands.Add(FlyoutCommand.No); closeAppFlyout.Action = deleteYHAction; if (mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout) == DialogResult.Yes) { ((Yhgl)mCurrentDocument.Control).DeleteYH(yh); } }
private void exitActionFunction() { var closeAppAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction() { Caption = "退出", Description = "确定要退出系统吗?" }; closeAppAction.Commands.Add(FlyoutCommand.Yes); closeAppAction.Commands.Add(FlyoutCommand.No); closeAppFlyout.Action = closeAppAction; if (mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout) == System.Windows.Forms.DialogResult.Yes) { Application.Exit(); } }
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; } }
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; } }
private void tileNotImplement_Click(object sender, TileClickEventArgs e) { var notImplmentAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction() { Caption = "提示", Description = "该功能正在研发中,敬请期待....." }; notImplmentAction.Commands.Add(FlyoutCommand.OK); closeAppFlyout.Action = notImplmentAction; mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout); e.Handled = true; }
private void exitActionFunction() { var closeAppAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction() { Caption = "退出", Description = "确定要退出系统吗?" }; closeAppAction.Commands.Add(FlyoutCommand.Yes); closeAppAction.Commands.Add(FlyoutCommand.No); closeAppFlyout.Action = closeAppAction; if (mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout) == System.Windows.Forms.DialogResult.Yes) { Application.Exit(); } }
private void aboutActionFunction() { var aboutAppAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction() { Caption = "关于", Description = "北斗大坝安全监测系统 V1.0\nCopyright@2012 福建泉州泰克通信设备有限公司" }; aboutAppAction.Commands.Add(FlyoutCommand.OK); closeAppFlyout.Action = aboutAppAction; mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout); }
/// <summary> /// 显示消息 /// </summary> /// <param name="caption">消息标题</param> /// <param name="message">消息内容</param> public void ShowMessage(string caption, string message) { var messageAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction() { Caption = caption, Description = message }; messageAction.Commands.Add(FlyoutCommand.OK); closeAppFlyout.Action = messageAction; mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout); }
/// <summary> /// 显示删除用户确认界面 /// </summary> /// <param name="yh">待删除的用户</param> public void ShowDeleteYHConfirm(Yh yh) { var deleteYHAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction() { Caption = "删除确认", Description = string.Format("确定要删除【{0}】用户吗?", yh.Xm) }; deleteYHAction.Commands.Add(FlyoutCommand.Yes); deleteYHAction.Commands.Add(FlyoutCommand.No); closeAppFlyout.Action = deleteYHAction; if (mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout) == DialogResult.Yes) { ((Yhgl)mCurrentDocument.Control).DeleteYH(yh); } }