private void WorkStationPanel_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { textEditDurus_Adi.Text = e.Button.Properties.Caption.ToString(); textEditDurus_Adi.Tag = Convert.ToInt32(e.Button.Properties.Tag.ToString()); }
private void wbntTinhtrangphong_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { switch (e.Button.Properties.Tag.ToString()) { case "Thêm phòng": //Nếu không có loại phòng, thông báo cần tạo loại phòng trước if (BUS.LoaiPhongBUS.LayTatCaLoaiPhong_List().Count == 0) { XtraMessageBox.Show("Cần phải thêm loại phòng trước!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } QuanlyPagecontrol.SelectedPage = PageThemphongmoi; break; case "Sửa phòng": if (gridView1.DataRowCount == 0) { XtraMessageBox.Show("Không có phòng nào được chọn", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } QuanlyPagecontrol.SelectedPage = PageSuaphong; 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(gridControl, 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 phòng": goToQuanLyLoaiPhong(); 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 windowsUIButtonPanel1_ButtonClick_1(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { this.TinhtrangPagecontrol.SelectedPage = PageTinhtrang; }
private void bgInfoNV_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { string tag = ((DevExpress.XtraBars.Docking2010.WindowsUIButton)e.Button).Tag.ToString(); switch (tag) { case "edit": // mở tính năng chỉnh sửa SetTextBoxEnabled(true); // ẩn button chỉnh sửa, mở các button save for (int i = 0; i < bgInfoNV.Buttons.Count; i++) { string btntag = bgInfoNV.Buttons[i].Properties.Tag.ToString(); if (btntag == "edit") { bgInfoNV.Buttons[i].Properties.Visible = false; } if (btntag == "save") { bgInfoNV.Buttons[i].Properties.Visible = true; } } break; case "close": // thoát this.Close(); break; case "save": // lưu lại thông tin // Kiểm tra các input có thỏa hay ko if (!isInputValid()) { XtraMessageBox.Show("Vui lòng kiểm tra các giá trị nhập vào, một số giá trị không hợp lệ nên không thể lưu thông tin", "Lưu thông tin", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (type == true) { themDL(); this.Close(); } else { if (update()) { if (XtraMessageBox.Show("Lưu thành công thông tin nhân viên", "Lưu", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK) { SetTextBoxEnabled(false); for (int i = 0; i < bgInfoNV.Buttons.Count; i++) { string btntag = bgInfoNV.Buttons[i].Properties.Tag.ToString(); if (btntag == "edit") { bgInfoNV.Buttons[i].Properties.Visible = true; } if (btntag == "save") { bgInfoNV.Buttons[i].Properties.Visible = false; } } } } } } break; } }
private void tileContainer1_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { TileControlForm tcForm = new TileControlForm(); tcForm.Show(); }
private void loaitruyen_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { popupMenu1.ShowPopup(new Point(MousePosition.X, MousePosition.Y)); _flag = 1; }
private void navigationPage1_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { }
private void windowsUIButtonPanel_Click(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { }
private void windowsUIButtonPanel1_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { switch (e.Button.Properties.Tag.ToString()) { case "Hủy": ((FlyoutDialog)this.Parent).Hide(); break; case "Thuê": //Kiểm tra khách hàng if (khachHang == null) { XtraMessageBox.Show("Không có khách hàng nào được chọn!", "Lỗi", MessageBoxButtons.OK); return; } //Kiểm tra xem phòng vẫn còn trống không foreach (PhongDTO phong in selectedPhong.Values) { if (PhongBUS.LayThongTinPhong(phong.MaPhong).MaTinhTrangPhong != 0) { XtraMessageBox.Show("Phòng " + phong.TenPhong + " hiện không có sẵn! Vui lòng chọn lại phòng khác", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txtPhong.Properties.DataSource = dtPhong = PhongBUS.LayTatCaPhong_TinhTrangPhong_LoaiPhong_CoSan(); selectedPhong.Clear(); txtPhong.Refresh(); return; } } //NOTE Tài khoản thanh toán //BÌNH //Phát sinh hóa đơn HoaDonDTO hoaDon = new HoaDonDTO(HoaDonBUS.PhatSinhMaHoaDon(), -1, Double.NaN, Convert.ToDouble(txtTienTraTruoc.EditValue), DateTime.MinValue, Double.NaN, txtGhiChu.Text, khachHang.MaKH, -1); HoaDonBUS.LuuThongTinHoaDon(hoaDon); ThuePhongDTO tp = null; foreach (PhongDTO phong in selectedPhong.Values) { tp = new ThuePhongDTO(ThuePhongBUS.PhatSinhMaThuePhong(), phong.MaPhong, (DateTime)txtGioVao.EditValue, DateTime.MinValue, hoaDon.MaHoaDon, double.NaN); ThuePhongBUS.LuuThongTinThuePhong(tp); PhongBUS.CapNhatTinhTrangPhong(phong, 1); } //Thông báo thành công onThuePhongSuccess(tp); ((FlyoutDialog)this.Parent).Hide(); break; default: break; } }
//if (e.Button.Properties.Caption == "Xoá") // if (XtraMessageBox.Show("Xoá sổ hộ khẩu?", "Xoá", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) // { // gridView1.DeleteSelectedRows(); // unitHOKHAU.CommitChanges(); // xpHOKHAU.Reload(); // XtraMessageBox.Show("Đã xoá sổ hộ khẩu", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); // gridView1_FocusedRowChanged(null, null); // } //if (e.Button.Properties.Caption == "Lưu") //{ // try // { // unitHOKHAU.CommitChanges(); // xpHOKHAU.Reload(); // XtraMessageBox.Show("Đã lưu", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); // gridView1_FocusedRowChanged(null, null); // } // catch (Exception) // { // return; // } //} private void dockPanel1_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { }
private void wbntThemphong_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { switch (e.Button.Properties.Tag.ToString()) { case "Thêm": if (txtTenLoaiPhong.Text == "") { txtTenLoaiPhong.ErrorText = "Tên loại phòng không được để trống"; return; } DonGiaTheoTuan giaTheoTuan = new DonGiaTheoTuan(); giaTheoTuan.MaLoaiPhong = Convert.ToInt32(textEdit2.Text); for (int i = 0; i < 8; i++) { for (int j = 0; j < 24; j++) { if (spreadsheetControl1.Document.Worksheets[0].Cells[j, i].Value.ToString() == "") { //Thông báo có cell trống XtraMessageBox.Show("Không thể thêm được do có đơn giá trống!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } } for (int i = 0; i < 8; i++) { DonGiaTheoNgay donGiaNgay = new DonGiaTheoNgay(); donGiaNgay.SetNgayTrongTuan(i); DonGiaTheoKhoangThoiGian donGia = new DonGiaTheoKhoangThoiGian(new DTO.ThongTinThanhToanTheoNgay.Gio(0, 0, 0), new DTO.ThongTinThanhToanTheoNgay.Gio(1, 0, 0), Convert.ToInt32(spreadsheetControl1.Document.Worksheets[0].Cells[0, i].Value.ToString())); for (int j = 1; j < 24; j++) { if (donGia.DonGia == Convert.ToInt32(spreadsheetControl1.Document.Worksheets[0].Cells[j, i].Value.ToString())) { donGia.GioKetThuc.AddHour(1); } else { donGiaNgay.listDonGiaTheoKhoangThoiGian.Add(donGia); donGia = new DonGiaTheoKhoangThoiGian(new DTO.ThongTinThanhToanTheoNgay.Gio(j, 0, 0), new DTO.ThongTinThanhToanTheoNgay.Gio(j + 1, 0, 0), Convert.ToInt32(spreadsheetControl1.Document.Worksheets[0].Cells[0, i].Value.ToString())); donGia.DonGia = Convert.ToInt32(spreadsheetControl1.Document.Worksheets[0].Cells[j, i].Value.ToString()); } //spreadsheetControl1.Document.Worksheets[0].Cells[j, i].NumberFormat = "##.000"; } donGiaNgay.listDonGiaTheoKhoangThoiGian.Add(donGia); giaTheoTuan.listDonGiaTheoNgay.Add(donGiaNgay); } BUS.LoaiPhongBUS.ThemLoaiPhong(LoaiPhongBUS.PhatSinhLoaiMaLoaiPhong(), txtTenLoaiPhong.Text); BUS.DonGia_LoaiPhongBUS.ThemDonGiaTheoKhoangThoiGian(giaTheoTuan); //Thông báo thành công XtraMessageBox.Show("Thêm loại phòng thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); goToHomeLoaiPhong(); break; case "Hủy": if (XtraMessageBox.Show("Bạn có muốn thoát khỏi thêm phòng (Mọi thông tin chưa được lưu sẽ mất) ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { goToHomeLoaiPhong(); } break; } }
private void wbntSuaphong_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { XtraInputBoxArgs args = new XtraInputBoxArgs(); // set required Input Box options args.Caption = "Thêm ngày lễ"; args.Prompt = "Ngày:"; args.DefaultButtonIndex = 0; args.Showing += Args_Showing; // initialize a DateEdit editor with custom settings DateEdit editor = new DateEdit(); editor.Properties.CalendarView = DevExpress.XtraEditors.Repository.CalendarView.TouchUI; editor.Properties.Mask.EditMask = "dd - MM"; args.Editor = editor; switch (e.Button.Properties.Tag.ToString()) { case "Thêm Ngày Lễ": args.DefaultResponse = DateTime.Now; if (XtraInputBox.Show(args) != null) { DateTime dt = new DateTime(2000, editor.DateTime.Month, editor.DateTime.Day); if (NgayLeBUS.KiemTraNgayLeTonTai(dt)) { XtraMessageBox.Show("Ngày lễ đã tồn tại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } NgayLeBUS.ThemNgayLe(new DTO.NgayLeDTO(NgayLeBUS.PhatSinhMaNgayLe(), editor.DateTime)); XtraMessageBox.Show("Thêm ngày lễ thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); RefeshDataBinding(); } break; case "Xóa Ngày Lễ": if (XtraMessageBox.Show("Xác nhận xóa ngày lễ '" + ((DateTime)dtNgayLe.Rows[gridView1.GetFocusedDataSourceRowIndex()]["NgayLe"]).ToString("dd - MM") + "'?", "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { NgayLeBUS.XoaNgayLe((int)dtNgayLe.Rows[gridView1.GetFocusedDataSourceRowIndex()]["MaNgayLe"]); RefeshDataBinding(); } break; case "Sửa Ngày Lễ": args.DefaultResponse = (DateTime)dtNgayLe.Rows[gridView1.GetFocusedDataSourceRowIndex()]["NgayLe"]; if (XtraInputBox.Show(args) != null) { DateTime dt = new DateTime(2000, editor.DateTime.Month, editor.DateTime.Day); if (NgayLeBUS.KiemTraNgayLeTonTai(dt)) { XtraMessageBox.Show("Ngày lễ đã tồn tại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } NgayLeBUS.SuaNgayLe(new DTO.NgayLeDTO((int)dtNgayLe.Rows[gridView1.GetFocusedDataSourceRowIndex()]["MaNgayLe"], editor.DateTime)); XtraMessageBox.Show("Sửa ngày lễ thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); RefeshDataBinding(); } break; case "Trở Lại": actionBack(); break; } }
private void bgInfoNV_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { int a = Convert.ToInt32(comboBox2.SelectedValue); string tag = ((DevExpress.XtraBars.Docking2010.WindowsUIButton)e.Button).Tag.ToString(); switch (tag) { case "edit": // mở tính năng chỉnh sửa SetTextBoxEnabled(true); loadcbb(); // ẩn button chỉnh sửa, mở các button save for (int i = 0; i < bgInfoNV.Buttons.Count; i++) { string btntag = bgInfoNV.Buttons[i].Properties.Tag.ToString(); if (btntag == "edit") { bgInfoNV.Buttons[i].Properties.Visible = false; } if (btntag == "save") { bgInfoNV.Buttons[i].Properties.Visible = true; } } break; case "close": // thoát this.Close(); break; case "save": // lưu lại thông tin // Kiểm tra các input có thỏa hay ko if (!isInputValid()) { XtraMessageBox.Show("Vui lòng kiểm tra các giá trị nhập vào, một số giá trị không hợp lệ nên không thể lưu thông tin", "Lưu thông tin", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (cListPeoPle.Instance.Update(txtHoTen.Text, txtPhone.Text, txtDiaChi.Text, txtEmail.Text, Convert.ToDateTime(txtNgaySinh.EditValue), txtMaNV.Text, a)) { if (SaveObj()) { if (XtraMessageBox.Show("Lưu thành công thông tin nhân viên", "Lưu", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK) { SetTextBoxEnabled(false); for (int i = 0; i < bgInfoNV.Buttons.Count; i++) { string btntag = bgInfoNV.Buttons[i].Properties.Tag.ToString(); if (btntag == "edit") { bgInfoNV.Buttons[i].Properties.Visible = true; } if (btntag == "save") { bgInfoNV.Buttons[i].Properties.Visible = false; } } } } } } break; } }
private void windowsUIButtonPanel1_ButtonChecked(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { DevExpress.XtraBars.Docking2010.WindowsUIButtonPanel tt = sender as DevExpress.XtraBars.Docking2010.WindowsUIButtonPanel; if (tt.Buttons[0].Properties.Checked == true) { tt.Buttons[1].Properties.Checked = false; tt.Buttons[0].Properties.Checked = false; tt.Buttons[2].Properties.Checked = false; if (transitionManager1.IsTransition) { transitionManager1.EndTransition(); } transitionManager1.StartTransition(xtraTabPage1); try { xtraTabPage1.PageVisible = true; xtraTabPage2.PageVisible = false; xtraTabPage3.PageVisible = false; xtraTabControl1.SelectedTabPage = xtraTabPage1; //this.pol_instructionsTableAdapter.Fill_pol(deloDataSet1.pol_instructions, Globals.id_sl_pol_ins); this.planTableAdapter.Fill(this.oplataDataSet.plan, god, mes); } finally { transitionManager1.EndTransition(); } } if (tt.Buttons[1].Properties.Checked == true) { tt.Buttons[1].Properties.Checked = false; tt.Buttons[0].Properties.Checked = false; tt.Buttons[2].Properties.Checked = false; if (transitionManager1.IsTransition) { transitionManager1.EndTransition(); } transitionManager1.StartTransition(xtraTabPage2); try { xtraTabPage1.PageVisible = false; xtraTabPage3.PageVisible = false; xtraTabPage2.PageVisible = true; xtraTabControl1.SelectedTabPage = xtraTabPage2; } finally { transitionManager1.EndTransition(); } } if (tt.Buttons[2].Properties.Checked == true) { tt.Buttons[2].Properties.Checked = false; tt.Buttons[1].Properties.Checked = false; tt.Buttons[0].Properties.Checked = false; if (transitionManager1.IsTransition) { transitionManager1.EndTransition(); } try { dateTimePicker1.Text = Convert.ToString(DateTime.Today); xtraTabPage3.PageVisible = true; xtraTabPage1.PageVisible = false; xtraTabPage2.PageVisible = false; DateTime now = Convert.ToDateTime(dateTimePicker1.Value); DateTime mes_naz = now.AddMonths(-1); DateTime god_naz = now.AddYears(-1); DateTime god_mes_naz = now.AddMonths(-1).AddYears(-1); this.analyseTableAdapter.Fill(this.oplataDataSet.analyse, now, now.AddDays(-1)); this.analyse1TableAdapter.Fill(this.oplataDataSet.analyse1, mes_naz, mes_naz.AddDays(-1)); this.analyse2TableAdapter.Fill(this.oplataDataSet.analyse2, now, now.AddDays(-1)); this.analyse3TableAdapter.Fill(this.oplataDataSet.analyse3, mes_naz, mes_naz.AddDays(-1)); this.analyse4TableAdapter.Fill(this.oplataDataSet.analyse4, now, now.AddDays(-1)); this.analyse5TableAdapter.Fill(this.oplataDataSet.analyse5, mes_naz, mes_naz.AddDays(-1)); ReportParameter date1 = new ReportParameter("date1", now.ToString()); ReportParameter date2 = new ReportParameter("date2", mes_naz.ToString()); ReportParameter date3 = new ReportParameter("date3", god_naz.ToString()); ReportParameter date4 = new ReportParameter("date4", god_mes_naz.ToString()); reportViewer1.LocalReport.SetParameters(new ReportParameter[] { date1 }); reportViewer1.LocalReport.SetParameters(new ReportParameter[] { date2 }); reportViewer1.LocalReport.SetParameters(new ReportParameter[] { date3 }); reportViewer1.LocalReport.SetParameters(new ReportParameter[] { date4 }); this.reportViewer1.RefreshReport(); } finally { transitionManager1.EndTransition(); } } }
/// <summary> /// 用于控制面板的翻页 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tabPageControl_windowsUIButtonPanel_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { DevExpress.XtraEditors.ButtonPanel.IBaseButton preBtn = this.tabPageControl_windowsUIButtonPanel.Buttons[0]; DevExpress.XtraEditors.ButtonPanel.IBaseButton nextBtn = this.tabPageControl_windowsUIButtonPanel.Buttons[1]; if (e.Button == preBtn && this.classfication_backstageViewControl.SelectedTabIndex != 0) { this.classfication_backstageViewControl.SelectedTabIndex -= 1; } else if (e.Button == nextBtn) { int currentTabIndex = this.classfication_backstageViewControl.SelectedTabIndex; switch (currentTabIndex) { case 0: // Select Method面板 if (supervise_checkEdit.Checked == false && unsupervise_checkEdit.Checked == false) { MessageBox.Show("Please select a method."); return; } else { if (supervise_checkEdit.Checked == true) { this.m_selectedMethod = (ClassifyAlgBase.ClassifyMethod)(superviseMethod_radioGroup.SelectedIndex + 1); } else if (unsupervise_checkEdit.Checked == true) { this.m_selectedMethod = (ClassifyAlgBase.ClassifyMethod)(unsuperviseMethod_radioGroup.SelectedIndex + 1 + 9); } if (preBtn.Properties.Enabled == false) { preBtn.Properties.Enabled = true; } initClassParamSettingPage(m_selectedMethod); turnNextTabPage(); } break; case 1: // Set Parameters面板 turnNextTabPage(); break; case 2: // Export Data面板 string inputPath = ""; string outputPath = ""; if (singleMode_checkEdit.Checked == true) { if (inDataFile_btn.Text == "") { MessageBox.Show("Please enter the input file."); return; } if (outDataFile_btn.Text == "") { MessageBox.Show("Please enter the output file."); return; } inputPath = this.inDataFile_btn.Text; outputPath = this.outDataFile_btn.Text; } else if (batchMode_checkEdit.Checked == true) { if (inDataFolder_btn.Text == "") { MessageBox.Show("Please enter the input file folder."); return; } if (outDataFolder_btn.Text == "") { MessageBox.Show("Please enter the output file folder."); return; } inputPath = inDataFolder_btn.Text; outputPath = outDataFolder_btn.Text; } // 设置Run面板中的初始化参数 this.class_method_textEdit.Text = ClassifyAlgBase.getMethodString(this.m_selectedMethod); this.class_inputfile_textEdit.Text = inputPath; this.class_outputfile_textEdit.Text = outputPath; turnNextTabPage(); break; case 3: // Run面板 if (m_processIsDone == false) { return; } turnNextTabPage(); break; case 4: // Finish面板 break; default: break; } } }
private void windowsUIButtonPanel_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { // if (e.Button.Properties.Caption == "In") gridControl.ShowRibbonPrintPreview(); switch (e.Button.Properties.Caption) { case "In": { gridControl.ShowRibbonPrintPreview(); break; } case "Thêm": { if (PropertieConst.quyen.Trim() == "user") { MessageBox.Show("Bạn không có quyền hạn đề thực hiện việc này !", "Cảnh báo !", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (isThem || isSua) { return; } Them(); break; } case "Xóa": { if (PropertieConst.quyen.Trim() == "user" || PropertieConst.quyen.Trim() == "manager") { MessageBox.Show("Bạn không có quyền hạn đề thực hiện việc này !", "Cảnh báo !", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (isThem || isSua) { return; } Xoa(); break; } case "Sửa": { if (PropertieConst.quyen.Trim() == "user") { MessageBox.Show("Bạn không có quyền hạn đề thực hiện việc này !", "Cảnh báo !", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (isThem || isSua) { return; } Sua(); break; } case "Tải lại": { if (isThem || isSua) { return; } LoadData(); break; } } }
private void wbntQuanlyphong_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { switch (e.Button.Properties.Tag.ToString()) { case "Thêm Dịch Vụ": folderDichVu.ChonDichVu chonDichVu = new folderDichVu.ChonDichVu(false); XtraDialogArgs args = new XtraDialogArgs(caption: "Chọn dịch vụ", content: chonDichVu, buttons: new DialogResult[] { DialogResult.OK, DialogResult.Cancel }); args.Showing += Args_Showing; if (XtraDialog.Show(args) == DialogResult.OK) { foreach (int dichVu_Key in chonDichVu.GetSelectedDichVu().Keys) { DichVuDatPhongBUS.LuuThongTinDichVuDatPhong(new DichVuDatPhongDTO(DichVuDatPhongBUS.PhatSinhMaDichVuPhong(), dichVu_Key, chonDichVu.GetSelectedDichVu()[dichVu_Key], DichVuBUS.LayThongTinDichVu(dichVu_Key).DonGia, chiTietDatPhong.MaChiTietDatPhong)); //DichVuBUS.LayThongTinDichVu(dichVu_Key); } RefreshDataBindingDichVuPhong(); } break; case "Chuyển Phòng": ChuyenPhong formChuyenPhong = new ChuyenPhong(chiTietDatPhong); if (FlyoutDialog.Show(this.FindForm(), formChuyenPhong) == DialogResult.OK) { XtraMessageBox.Show("Chuyển phòng thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); (Parent.Parent.Parent as ThongTinChiTietDatNhieuPhong).RefreshData(); } break; case "Xóa Dịch Vụ": if (XtraMessageBox.Show("Bạn có chắc muốn xóa dịch vụ '" + dichVuPhong.Rows[gridView1.GetFocusedDataSourceRowIndex()]["TenDV"] + "' ?", "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { DichVuDatPhongBUS.XoaDichVuDatPhong((int)dichVuPhong.Rows[gridView1.GetFocusedDataSourceRowIndex()]["MaDichVuDatPhong"]); RefreshDataBindingDichVuPhong(); } break; case "Nhận Phòng": //Thông báo xác nhận if (XtraMessageBox.Show("Xác nhận nhận đặt phòng?", "Xác nhận", MessageBoxButtons.YesNo) == DialogResult.No) { return; } (Parent.Parent.Parent as ThongTinChiTietDatNhieuPhong).NhanPhong(); break; case "Hủy Phòng": //Thông báo xác nhận if (XtraMessageBox.Show("Bạn có chắc hủy phòng đã đặt này ?", "Xác nhận", MessageBoxButtons.YesNo) == DialogResult.No) { return; } Dictionary <int, DatPhongDTO> tempSapDat_1 = BUS.DatPhongBUS.LayCacDatPhongDangSapDuocDatVaDangDuocDat(ThamSoBUS.LayKhoangThoiGianChoDatPhong()); //Hủy đặt phòng if (DatPhongBUS.DemSoLuongChiTietDatPhong(chiTietDatPhong.MaDatPhong) == 1) { foreach (ChiTietDatPhongDTO dp in DatPhongBUS.LayTatCaCacChiTietDatPhong(chiTietDatPhong.MaDatPhong)) { if (PhongBUS.LayThongTinPhong(dp.MaPhong).MaTinhTrangPhong == 4 && tempSapDat_1.ContainsKey(dp.MaDatPhong)) { PhongBUS.CapNhatTinhTrangPhong(dp.MaPhong, 0); } else if (PhongBUS.LayThongTinPhong(dp.MaPhong).MaTinhTrangPhong == 6 && tempSapDat_1.ContainsKey(dp.MaDatPhong)) { PhongBUS.CapNhatTinhTrangPhong(dp.MaPhong, 5); } else if (PhongBUS.LayThongTinPhong(dp.MaPhong).MaTinhTrangPhong == 7 && tempSapDat_1.ContainsKey(dp.MaDatPhong)) { PhongBUS.CapNhatTinhTrangPhong(dp.MaPhong, 1); } } DatPhongBUS.CapNhatTinhTrangDatPhong(3, chiTietDatPhong.MaDatPhong); (Parent.Parent.Parent as ThongTinChiTietDatNhieuPhong).RefreshData(); break; } //Hủy phòng if (PhongBUS.LayThongTinPhong(chiTietDatPhong.MaPhong).MaTinhTrangPhong == 4 && tempSapDat_1.ContainsKey(chiTietDatPhong.MaDatPhong)) { PhongBUS.CapNhatTinhTrangPhong(chiTietDatPhong.MaPhong, 0); } else if (PhongBUS.LayThongTinPhong(chiTietDatPhong.MaPhong).MaTinhTrangPhong == 6 && tempSapDat_1.ContainsKey(chiTietDatPhong.MaDatPhong)) { PhongBUS.CapNhatTinhTrangPhong(chiTietDatPhong.MaPhong, 5); } else if (PhongBUS.LayThongTinPhong(chiTietDatPhong.MaPhong).MaTinhTrangPhong == 7 && tempSapDat_1.ContainsKey(chiTietDatPhong.MaDatPhong)) { PhongBUS.CapNhatTinhTrangPhong(chiTietDatPhong.MaPhong, 1); } DatPhongBUS.XoaCacDichVuDatPhong(chiTietDatPhong); DatPhongBUS.XoaDatChiTietDatPhong(chiTietDatPhong); //if (DatPhongBUS.DemSoLuongChiTietDatPhong(chiTietDatPhong.MaDatPhong) == 0) //{ // DatPhongBUS.XoaDatPhong(chiTietDatPhong.MaDatPhong); //} XtraMessageBox.Show("Xóa đặt phòng thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); (Parent.Parent.Parent as ThongTinChiTietDatNhieuPhong).RefreshData(); //ThuePhongBUS.XoaThuePhong(thuePhong); //PhongBUS.CapNhatTinhTrangPhong(thuePhong.MaPhong, 0); //if (HoaDonBUS.DemSoLuongThuePhong(hoaDon.MaHoaDon) == 0) //{ // HoaDonBUS.XoaHoaDon(hoaDon); //} //((ThongTinChiTietNhieuPhong)Parent.Parent.Parent).OnXoaPhong(); break; case "Hủy Đặt Phòng": //Thông báo xác nhận if (XtraMessageBox.Show("Bạn có chắc hủy đặt phòng này ?", "Xác nhận", MessageBoxButtons.YesNo) == DialogResult.No) { return; } //BUS.PhongBUS.CapNhatTinhTrangPhong(chiTiet.MaPhong, 0); Dictionary <int, DatPhongDTO> tempSapDat = BUS.DatPhongBUS.LayCacDatPhongDangSapDuocDatVaDangDuocDat(ThamSoBUS.LayKhoangThoiGianChoDatPhong()); foreach (ChiTietDatPhongDTO dp in DatPhongBUS.LayTatCaCacChiTietDatPhong(chiTietDatPhong.MaDatPhong)) { if (PhongBUS.LayThongTinPhong(dp.MaPhong).MaTinhTrangPhong == 4 && tempSapDat.ContainsKey(dp.MaDatPhong)) { PhongBUS.CapNhatTinhTrangPhong(dp.MaPhong, 0); } else if (PhongBUS.LayThongTinPhong(dp.MaPhong).MaTinhTrangPhong == 6 && tempSapDat.ContainsKey(dp.MaDatPhong)) { PhongBUS.CapNhatTinhTrangPhong(dp.MaPhong, 5); } else if (PhongBUS.LayThongTinPhong(dp.MaPhong).MaTinhTrangPhong == 7 && tempSapDat.ContainsKey(dp.MaDatPhong)) { PhongBUS.CapNhatTinhTrangPhong(dp.MaPhong, 1); } } DatPhongBUS.CapNhatTinhTrangDatPhong(3, chiTietDatPhong.MaDatPhong); (Parent.Parent.Parent as ThongTinChiTietDatNhieuPhong).RefreshData(); break; case "In phiếu đặt": { (Parent.Parent.Parent as ThongTinChiTietDatNhieuPhong).InPhieuDat(); break; } } }
private void wbntBack_sualoaiphong_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { LoaiPhongPagecontrol.SelectedPage = PageLoaiphong; }
private void wbntThemphong_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { this.TinhtrangPagecontrol.SelectedPage = this.PageTinhtrang; }
private void nav_more_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { open_more(); }
private void tuatruyen_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { }