// контектные кнопки информации о сотруднике public void gcPerformerInformation_CustomButtonClick(System.Object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { int _min = 30; int _max = 193; switch (e.Button.Properties.GroupIndex) { case 0: // Статистика подключений break; case 2: // Свернуть / Развернуть if ((int)e.Button.Properties.Tag == 0) // свернуть { e.Button.Properties.Tag = 1; e.Button.Properties.ImageOptions.Image = global::My.Resources.Resources.down_20x20; this.gcPerformerInformation.Size = new Size(this.gcPerformerInformation.Size.Width, 30); this.tlRightsPerformer.Location = new Point(this.tlRightsPerformer.Location.X, this.tlRightsPerformer.Location.Y - (_max - _min)); this.tlRightsPerformer.Size = new Point(this.tlRightsPerformer.Size.Width, this.tlRightsPerformer.Size.Height + (_max - _min)); } // развернуть else if ((int)e.Button.Properties.Tag == 1) { e.Button.Properties.Tag = 0; e.Button.Properties.ImageOptions.Image = global::My.Resources.Resources.up_20x20; this.gcPerformerInformation.Size = new Size(this.gcPerformerInformation.Size.Width, 193); this.tlRightsPerformer.Location = new Point(this.tlRightsPerformer.Location.X, this.tlRightsPerformer.Location.Y + (_max - _min)); this.tlRightsPerformer.Size = new Point(this.tlRightsPerformer.Size.Width, this.tlRightsPerformer.Size.Width - (_max - _min)); } break; } }
//NHAP private void groupControl2_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (e.Button == groupControl2.CustomHeaderButtons[0])//LUU { btn_Save(); LOAD_CBO(); loaddata(); } if (e.Button == groupControl2.CustomHeaderButtons[1])//XOA { btn_delete(); LOAD_CBO(); loaddata(); } if (e.Button == groupControl2.CustomHeaderButtons[2])//FRESH { btnRefesh(); LOAD_CBO(); loaddata(); } if (e.Button == groupControl2.CustomHeaderButtons[3])//CLOSE { this.Hide(); } }
private void grpc2_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (chinhSachOBindingSource.Count > 1) { switch (e.Button.Properties.Caption) { case "Thêm": XuLyDuLieu.ConvertClassToTable(this, new O_CTCHINHSACH()); igroupControl1.Text = "Chi tiết chính sách thêm"; btnHuy.Enabled = btnLuu.Enabled = true; chk.Checked = true; break; default: if (GVCTCS.GetSelectedRows().Count() > 0) { _CTchinhSachO = GVCTCS.GetRow(GVCTCS.GetSelectedRows()[0]) as O_CTCHINHSACH; if (_CTchinhSachO != null) { btnHuy.Enabled = btnLuu.Enabled = true; igroupControl1.Text = "Chi tiết chính sách sửa"; XuLyDuLieu.ConvertClassToTable(this, _CTchinhSachO); chk.Checked = false; } } break; } } }
private void gpcDevicesInfo_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (e.Button.Properties.Caption == "搜索设备") { if (!this.ExcuteSearchDevices()) { return; } //if(this.IsBusy) //{ // return; //} //f_DevicesDataTable.Clear(); //if(!this.SearchDevices()) //{ // return; //} ////发送报文成功开始计时 //this.BeginTick = Environment.TickCount; //this.CoolingTick = 3000; //this.IsBusy = true; //f_SearchDevicesCount = 2; //剩余自动广播次数 HintProvider.StartWaiting(null, "正在搜索设备", "", Application.ProductName, showDelay: 0, showCloseButtonDelay: int.MaxValue); //this.tmrCommunication.Start(); } }
// группа чеков методов public void gcnMethods_CustomButtonChecked(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { GroupBoxButton btn = e.Button; switch (btn.Caption) { case "btnSearch_Method": this.gvMethod.OptionsFind.AlwaysVisible = btn.Checked; // при отключении очищаем фильтрацию if (btn.Checked == false) { this.gvMethod.FindFilterText = null; } break; case "btnAutoFilter_Method": this.gvMethod.OptionsView.ShowAutoFilterRow = btn.Checked; // при отключении очищаем фильтрацию if (btn.Checked == false) { this.gvMethod.ClearColumnsFilter(); } break; } }
private void layoutControlGroup2_CustomButtonClick_1(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (e.Button.Properties.Caption == "Làm mới") { LoadHoKhau(); alertControl1.Show(this, "Thông báo", "Đã làm mới"); } if (e.Button.Properties.Caption == "Lưu") { if (textEdit1.Text != "0") { foreach (var item in new XPQuery <HOKHAU>(Session.DefaultSession).Where(o => o.SOHOKHAU == Convert.ToInt32(textEdit1.Text))) { item.NGAYDK = Convert.ToDateTime(textEdit3.Text); item.Save(); } } LoadHoKhau(); alertControl1.Show(this, "Thông báo", "Đã lưu"); gridView1_FocusedRowChanged(null, null); } if (e.Button.Properties.Caption == "Xoá") { if (XtraMessageBox.Show("Xoá sổ hộ khẩu?", "Xoá", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { foreach (var item in new XPQuery <HOKHAU>(Session.DefaultSession).Where(o => o.SOHOKHAU == Convert.ToInt32(textEdit1.Text))) { item.Delete(); } LoadHoKhau(); alertControl1.Show(this, "Thông báo", "Đã xoá sổ hộ khẩu"); gridView1_FocusedRowChanged(null, null); } } }
// группа кнопок классификаций public void gcnClassification_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { GroupBoxButton btn = e.Button; // Console.WriteLine(e.Button.Properties.Caption) switch (btn.Caption) { case "btnAddClassification": btnAddClassification(2); break; case "btnEditClassfication": if (this.gvClassification.RowCount != 0) { btnAddClassification(3); } break; case "btnDeleteClassfication": if (this.gvClassification.RowCount != 0) { btnDeleteClassfication(); } break; case "btnClearSort_Classfication": this.gvClassification.ClearSorting(); break; } }
private void groupControl1_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { try { if (Convert.ToInt32(e.Button.Properties.Tag) == 1) { string tDN = nHANVIEN1DataGridView.CurrentRow.Cells[0].Value.ToString(); string manhom = qL_NHOM_NGUOIDUNGComboBox.SelectedValue.ToString(); qL_NGUOIDUNGNHOMNGUOIDUNGTableAdapter.Insert(tDN, manhom, string.Empty); load(); XtraMessageBox.Show("Thêm thành công", "Thông báo"); } else if (Convert.ToInt32(e.Button.Properties.Tag) == 2) { string tDN = qL_NGUOIDUNGNHOMNGUOIDUNG1DataGridView.CurrentRow.Cells[0].Value.ToString(); string manhom = qL_NHOM_NGUOIDUNGComboBox.SelectedValue.ToString(); qL_NGUOIDUNGNHOMNGUOIDUNGTableAdapter.Delete(tDN, manhom, string.Empty); load(); XtraMessageBox.Show("Xóa thành công", "Thông báo"); } } catch { XtraMessageBox.Show("Nhân viên đã tồn tại trong nhóm này !"); } }
private void groupControl1_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (new int[] { 0, 1, 2, 3, 8 }.Contains(int.Parse(iLoaiKhachHang.EditValue.ToString()))) { if ((iMaDL.Text ?? "").ToString().Length < 1 && iLoaiKhachHang.EditValue.ToString() == "8") { XuLyGiaoDien.ShowToolTip(iMaDL, "Chọn nhà cung cấp"); return; } switch (e.Button.Properties.Caption) { case "Hoàn": new frmNHVH(int.Parse(iMaDL.EditValue.ToString()), iLoaiKhachHang.EditValue.ToString() == "8", CTM.ID).ShowDialog(this); break; case "Vé": new frmNHV(int.Parse(iMaDL.EditValue.ToString()), iLoaiKhachHang.EditValue.ToString() == "8", CTM.ID).ShowDialog(this); break; case "Cấn trừ KS": new frmNHKSCT(iLoaiKhachHang.EditValue.ToString() == "8", CTM.ID).ShowDialog(this); break; default: new frmNHKS(int.Parse(iMaDL.EditValue.ToString()), iLoaiKhachHang.EditValue.ToString() == "8", CTM.ID).ShowDialog(this); break; } } else { XuLyGiaoDien.ShowToolTip(iLoaiKhachHang, "Chọn nguồn tới không được hỗ trợ"); } }
private void groupControl3_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { D_GIAODICH giaoDichD = new D_GIAODICH(); List <Dictionary <string, object> > lstDicS = new List <Dictionary <string, object> >(); List <string> lstTb = new List <string>(); List <string> lstCTV = new List <string>(); List <string> lstThem = new List <string>(); lstThem.Add("S"); lstThem.Add("S"); lstThem.Add("T"); lstTb.Add("GIAODICH"); lstTb.Add("GIAODICH"); lstTb.Add("LS_GIAODICH"); if (!XuLyGiaoDien.wait.IsSplashFormVisible) { XuLyGiaoDien.wait.ShowWaitForm(); } List <O_GIAODICH> sss = lstGDR4.Where(w => w.GhiChu.Contains("Khác kì") || w.GhiChu.Contains("Khác ngày")).ToList(); for (int i = 0; i < sss.Count(); i += 2) { XuLyGiaoDien.wait.SetWaitFormDescription(string.Format("Đang chỉnh ngày GD {0}/{1}", i, sss.Count())); Thread.Sleep(10); O_GIAODICH gd = sss[i]; O_GIAODICH gd2 = sss[i + 1]; Dictionary <string, object> dicS = new Dictionary <string, object>(); Dictionary <string, object> dicS3 = new Dictionary <string, object>(); dicS3.Add("NgayGD", gd2.NgayGD); lstCTV.Add(string.Format("WHERE ID = {0}", gd2.ID)); lstDicS.Add(dicS3); dicS.Add("NgayGD", gd.NgayGD); lstCTV.Add(string.Format("WHERE ID = {0}", gd.ID)); lstDicS.Add(dicS); Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("FormName", "Tự động"); dic.Add("MaCho", gd.SoVeVN); dic.Add("NoiDung", "[Vé hoàn]: Chỉnh ngày bằng so sánh VN"); dic.Add("NVGiaoDich", DuLieuTaoSan.NV.ID); dic.Add("LoaiKhachHang", 0); dic.Add("Ma", 0); lstCTV.Add(string.Empty); lstDicS.Add(dic); if (lstDicS.Count == 3) { giaoDichD.CapNhat_ThemNhieu(lstDicS, lstTb, lstCTV, lstThem); lstDicS.Clear(); lstCTV.Clear(); } } XuLyGiaoDien.ExportExcel(gridControl4, gridView8, "ExHoan-" + DateTime.Now.ToString("dd-MM-yyy")); if (XuLyGiaoDien.wait.IsSplashFormVisible) { XuLyGiaoDien.wait.CloseWaitForm(); } }
private void ScanLogGroupControl_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (e.Button.Properties.Caption == "Cancel") { CancelScan(); } }
// группа кнопок направлений public void gcnDirection_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { GroupBoxButton btn = e.Button; switch (btn.Caption) { case "btnAddDirection": btnAddDirections(2); break; case "btnEditDirection": if (this.gvDirection.RowCount != 0) { btnAddDirections(3); } break; case "btnDeleteDirection": if (this.gvDirection.RowCount != 0) { btnDeleteDirections(); } break; case "btnClearSort_Direction": this.gvDirection.ClearSorting(); break; } }
private void groupButton_CustomButtonChecked(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { groupButton.Size = new Size(44, 613); groupButton.CustomHeaderButtons[0].Properties.Image = Properties.Resources.forward_16x16; groupButton.CustomHeaderButtons[0].Properties.Checked = true; groupButton.Text = " "; xlsx_.write_xml("groupExpand", "True"); }
private void grpc2_CustomButtonUnchecked(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (e.Button.Properties.Caption == "Hiện đủ" && e.Button.Properties.Checked == false) { HienDu2 = false; } LayChiTiet(); }
private void layoutControlGroup2_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (e.Button.Properties.Caption == "Làm mới") { LoadHoKhau(); alertControl1.Show(this, "Thông báo", "Đã làm mới"); } }
private void Lv1TheoDoi_CustomButtonChecked(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { GroupControl Gp = sender as GroupControl; foreach (Control ctl1 in Gp.Controls) { ctl1.Enabled = true; } }
private void grpc1_CustomButtonUnchecked(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (e.Button.Properties.Caption == "Đại lý" && e.Button.Properties.Checked == false) { _LoaiKhachHang = 2; } DuLieu(); }
private void groupButton_CustomButtonUnchecked(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { groupButton.Size = new Size(230, 613); groupButton.CustomHeaderButtons[0].Properties.Image = Properties.Resources.backward_16x16; groupButton.CustomHeaderButtons[0].Properties.Checked = false; groupButton.Text = "Управление"; xlsx_.write_xml("groupExpand", "False"); }
private void GroupControl_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { BarItem item = e.Button.Properties.Tag as BarItem; if (item != null) { item.PerformClick(); } }
private void AccountDetailInfo_GroupControl_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { AccountDetailCopy frm = new AccountDetailCopy(); if (frm.ShowDialog() == DialogResult.OK) { LoadAccountDetailGridView(); } }
private void groupControl1_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { switch (e.Button.Properties.Caption) { case "Export": gridView1.ShowPrintPreview(); break; } }
private void layoutControlGroup3_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (e.Button.Properties.Caption == "Làm mới") { xpBAOTU.Reload(); alertControl1.Show(this, "Thông báo", "Đã làm mới"); } if (e.Button.Properties.Caption == "Lưu") { SplashScreenManager.ShowDefaultWaitForm("Đang tải", "Vui lòng chờ..."); try { unitBAOTU.CommitChanges(); foreach (var item in iList) { foreach (var item1 in xpNHANKHAU.Cast <NHANKHAU>().Where(o => o.MAKHAISINH == item)) { item1.DAMAT = true; item1.Save(); } } iList.Clear(); alertControl1.Show(this, "Thông báo", "Đã lưu"); } catch (Exception) { } SplashScreenManager.CloseDefaultWaitForm(); } if (e.Button.Properties.Caption == "Xoá") { if (gridView1.GetFocusedRowCellValue("MAKHAISINH") != null) { if (XtraMessageBox.Show("Xóa báo tử?", "Xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { SplashScreenManager.ShowDefaultWaitForm("Đang xóa", "Vui lòng chờ"); foreach (var item1 in xpNHANKHAU.Cast <NHANKHAU>().Where(o => o.MAKHAISINH == Convert.ToString(gridView1.GetFocusedRowCellValue("MAKHAISINH")))) { item1.DAMAT = false; item1.Save(); } gridView1.DeleteSelectedRows(); try { unitBAOTU.CommitChanges(); alertControl1.Show(this, "Thông báo", "Xóa thành công"); } catch (Exception) { alertControl1.Show(this, "Thông báo", "Không thể xóa"); return; } SplashScreenManager.CloseDefaultWaitForm(); } } } }
private void gc_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { DataTable sdt = BaseService.Open("SystemStep_Default", null); DataTable tdt = (DataTable)gdc.DataSource; foreach (DataRow dr in sdt.Rows) { dr.SetAdded(); } tdt.Merge(sdt); }
private void Items_GroupControl_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (e.Button.Properties.Caption == ExcelOperator.ImportSymbol) { ImportData(3); } else if (e.Button.Properties.Caption == ExcelOperator.ExportSymbol) { ExportData(3); } }
private void GrpMain_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { switch (e.Button.Properties.Caption) { case "أغلاق": this.Close(); break; default: break; } }
/// <summary> /// Event for grpDatabases when click one of custom buttons /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GrpDatabases_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { switch (e.Button.Properties.Caption) { case "نسخة": backup(); break; default: break; } }
private void gcIndexInformation_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { if (string.IsNullOrEmpty(txtTableName.Text)) { MessageBox.Show("Table name have to be filled!"); return; } gvIndex.CloseEditor(); gvIndex.UpdateCurrentRow(); gvIndex.AddNewRow(); gvIndex.CloseEditor(); gvIndex.UpdateCurrentRow(); }
private void groupControl2_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { switch (groupControl2.CustomHeaderButtons.IndexOf(e.Button)) { case 0: //AST this.navigationFrame1.SelectedPage = navigationPage2; break; case 1: //LV this.navigationFrame1.SelectedPage = navigationPage1; break; } }
private void gcMain_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { switch (gcMain.CustomHeaderButtons.IndexOf(e.Button)) { case 0: //Speichern this.SaveData(); break; case 1: //Abbrechen case 2: //Reload this.LoadData(); break; } }
private void splitContainerControl3_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) { var i = gridView2.FocusedRowHandle; double soluong = 0; if (e.Button.Properties.Caption == "Thêm") { soluong = Convert.ToDouble(Data.GetData($@"select soluong from tbl_chitiet_hoadon where mahang='{gridView2.GetRowCellValue(i, "mahang")}' and mahoadon='{lblMaHD.Text}'")) + 1; Data.RunCMD($@"update tbl_chitiet_hoadon set soluong='{soluong}' where mahang='{gridView2.GetRowCellValue(i, "mahang")}' and mahoadon='{lblMaHD.Text}'"); } else if (e.Button.Properties.Caption == "Bớt") { soluong = Convert.ToDouble(Data.GetData($@"select soluong from tbl_chitiet_hoadon where mahang='{gridView2.GetRowCellValue(i, "mahang")}' and mahoadon='{lblMaHD.Text}'")) - 1; if (soluong < 1) { return; } Data.RunCMD($@"update tbl_chitiet_hoadon set soluong='{soluong}' where mahang='{gridView2.GetRowCellValue(i, "mahang")}' and mahoadon='{lblMaHD.Text}'"); } else if (e.Button.Properties.Caption == "Xóa") { Data.RunCMD($@"delete from tbl_chitiet_hoadon where mahang='{gridView2.GetRowCellValue(i, "mahang")}' and mahoadon='{lblMaHD.Text}'"); } else if (e.Button.Properties.Caption == "Chiếc khấu (%)") { double chieckhau = 0; chieckhau = Convert.ToDouble(Data.GetData($@"select chieckhau from tbl_chitiet_hoadon where mahoadon='{lblMaHD.Text}' group by chieckhau")) + 5; Data.RunCMD($@"update tbl_chitiet_hoadon set chieckhau='{chieckhau}' where mahoadon='{lblMaHD.Text}'"); } else if (e.Button.Properties.Caption == "Lưu") { for (var index = 0; index <= gridView2.RowCount - 1; index++) { var dr = gridView2.GetDataRow(Convert.ToInt32(index)); if (ReferenceEquals(dr, null)) { break; } if (dr.RowState == DataRowState.Modified) { Data.RunCMD($@"update tbl_chitiet_hoadon set soluong='{ dr["soluong"] }', dongia='{dr["dongia"]}', chieckhau='{dr["chieckhau"]}', thoigian2='{ DateTime.Now.ToString() }', nguoitd2='{ Data._strtendangnhap.ToUpper() }' where mahoadon='{ dr["mahoadon"] }' and mahang='{dr["mahang"]}'"); //Ghi lại log Data.HistoryLog($@"Đã cập nhật lại thông tin chi tiết mặt hàng { dr["tenhang"] } của hóa đơn {dr["mahoadon"]}", "Chi tiết hóa đơn"); } } XtraMessageBox.Show($@"Đã cập nhật chi tiết hóa đơn {lblMaHD.Text}.", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } LoadChiTietHoaDon(lblMaHD.Text); LoadTinhTienHoaDon(); }