/// <summary> /// Sự kiện shortcutkey /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnShortcutKey_Click(object sender, RoutedEventArgs e) { string strTinhNang = ((MenuItem)sender).Name.Substring(3, ((MenuItem)sender).Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TU_CHOI_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THOAI_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TIM_KIEM))) { txtTimKiemNhanh.RaiseEvent(new RoutedEventArgs(Button.GotFocusEvent)); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LAY_LAI))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { XuatExcel(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { onHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { CustomControl.CommonFunction.CloseUserControl(this); } }
private void btnShortcutKey_Click(object sender, RoutedEventArgs e) { string strTinhNang = ((MenuItem)sender).Name.Substring(3, ((MenuItem)sender).Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRINH_DUYET))) { OnSave(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { OnHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { OnClose(); } }
private void tlbHotKey_Click(object sender, RoutedEventArgs e) { RibbonButton tlb = (RibbonButton)sender; string strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU))) { OnSave(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { OnHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { OnClose(); } }
/// <summary> /// Sự kiện hot key /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbHotKey_Click(object sender, RoutedEventArgs e) { RibbonButton tlb = (RibbonButton)sender; string strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM))) { onView(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { onHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { CustomControl.CommonFunction.CloseUserControl(this); } }
private void btnShortcutKey_Click(object sender, RoutedEventArgs e) { string strTinhNang = ((MenuItem)sender).Name.Substring(3, ((MenuItem)sender).Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU_TAM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU))) { OnSave(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THEM))) { BeforeAddNew(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { BeforeModifyFromDetail(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { BeforeDelete(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TU_CHOI_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THOAI_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM_TRUOC))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { OnHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { OnClose(); } }
/// <summary> /// Sự kiện hot key /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbHotKey_Click(object sender, RoutedEventArgs e) { RibbonButton tlb = (RibbonButton)sender; string strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THEM))) { BeforeAddNew(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { BeforeModify(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { BeforeDelete(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM))) { BeforeView(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TIM_KIEM))) { TimKiem(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LAY_LAI))) { LayLai(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { XuatExcel(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { onHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { CustomControl.CommonFunction.CloseUserControl(this); } }
/// <summary> /// Sự kiện shortcutkey /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnShortcutKey_Click(object sender, RoutedEventArgs e) { string strTinhNang = ((MenuItem)sender).Name.Substring(3, ((MenuItem)sender).Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LAY_LAI))) { Reload(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { XuatExcel(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { onClose(); } }
private void BindShortkey() { foreach (var child in Toolbar.Children) { if (child.GetType() == typeof(RibbonButton)) { RibbonButton tlb = (RibbonButton)child; KeyBinding key = new KeyBinding(); string strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRINH_DUYET))) { KeyGesture keyg = new KeyGesture(Key.S, ModifierKeys.Control); key = new KeyBinding(SaveCommand, keyg); } if (key != null) { InputBindings.Add(key); } } } }
private void btnShortcutKey_Click(object sender, RoutedEventArgs e) { string strTinhNang = ((MenuItem)sender).Name.Substring(3, ((MenuItem)sender).Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TIM_KIEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { XuatExcel(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { onHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { CustomControl.CommonFunction.CloseUserControl(this); } }
/// <summary> /// Sự kiện hot key /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbHotKey_Click(object sender, RoutedEventArgs e) { RibbonButton tlb = (RibbonButton)sender; string strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LAY_LAI))) { Reload(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { XuatExcel(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { onHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { onClose(); } }
private void tlbHotKey_Click(object sender, RoutedEventArgs e) { RibbonButton tlb = (RibbonButton)sender; string strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU_TAM))) { OnHold(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRINH_DUYET))) { OnSave(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THEM))) { BeforeAddNew(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { BeforeModifyFromDetail(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { BeforeDelete(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM_TRUOC))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { OnHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { OnClose(); } }
private void BindShortkey() { foreach (var child in Toolbar.Children) { if (child.GetType() == typeof(RibbonButton)) { RibbonButton tlb = (RibbonButton)child; KeyBinding key = new KeyBinding(); string strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU))) { KeyGesture keyg = new KeyGesture(Key.S, ModifierKeys.Control); key = new KeyBinding(SaveCommand, keyg); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { KeyGesture keyg = new KeyGesture(Key.M, ModifierKeys.Control); key = new KeyBinding(ModifyCommand, keyg); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { KeyGesture keyg = new KeyGesture(Key.Delete, ModifierKeys.Shift); key = new KeyBinding(DeleteCommand, keyg); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { KeyGesture keyg = new KeyGesture(Key.F1, ModifierKeys.None); key = new KeyBinding(HelpCommand, keyg); } if (key != null) { InputBindings.Add(key); } } } }
/// <summary> /// Sự kiện shortcutkey /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnShortcutKey_Click(object sender, RoutedEventArgs e) { string strTinhNang = ((MenuItem)sender).Name.Substring(3, ((MenuItem)sender).Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAP_DU_LIEU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THEM))) { //ClearForm(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { //Sua(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { //Xoa(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAN_BAN))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU_TAM))) { //LuuDuLieu(BusinessConstant.TrangThaiBanGhi.SU_DUNG, BusinessConstant.TrangThaiNghiepVu.LUU_TAM, DatabaseConstant.Action.LUU_TAM); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU))) { //LuuDuLieu(BusinessConstant.TrangThaiBanGhi.SU_DUNG, BusinessConstant.TrangThaiNghiepVu.CHO_DUYET, DatabaseConstant.Action.LUU); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.BANG_KE))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DUYET))) { //Duyet(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TU_CHOI_DUYET))) { //TuChoiDuyet(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THOAI_DUYET))) { //ThoaiDuyet(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM_TRUOC))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TIM_KIEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { onHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { CustomControl.CommonFunction.CloseUserControl(this); } }
/// <summary> /// Dang ky hot key, shortcut key /// </summary> #region Dang ky hot key, shortcut key /// <summary> /// Binding HotKey /// </summary> private void BindHotkey() { foreach (var child in Toolbar.Children) { if (child.GetType() == typeof(RibbonButton)) { RibbonButton tlb = (RibbonButton)child; KeyBinding key = new KeyBinding(); string strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAP_DU_LIEU))) { KeyGesture keyg = new KeyGesture(Key.I, ModifierKeys.Shift); key = new KeyBinding(ImportCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { KeyGesture keyg = new KeyGesture(Key.M, ModifierKeys.Control); key = new KeyBinding(ModifyCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { KeyGesture keyg = new KeyGesture(Key.Delete, ModifierKeys.Shift); key = new KeyBinding(DeleteCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAN_BAN))) { KeyGesture keyg = new KeyGesture(Key.V, ModifierKeys.Control | ModifierKeys.Shift); key = new KeyBinding(CloneCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU_TAM))) { KeyGesture keyg = new KeyGesture(Key.H, ModifierKeys.Control); key = new KeyBinding(HoldCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU))) { KeyGesture keyg = new KeyGesture(Key.S, ModifierKeys.Control); key = new KeyBinding(SaveCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.BANG_KE))) { KeyGesture keyg = new KeyGesture(Key.W, ModifierKeys.Control | ModifierKeys.Shift); key = new KeyBinding(CashStmtCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DUYET))) { KeyGesture keyg = new KeyGesture(Key.A, ModifierKeys.Control | ModifierKeys.Shift); key = new KeyBinding(ApproveCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TU_CHOI_DUYET))) { KeyGesture keyg = new KeyGesture(Key.R, ModifierKeys.Control | ModifierKeys.Shift); key = new KeyBinding(RefuseCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THOAI_DUYET))) { KeyGesture keyg = new KeyGesture(Key.C, ModifierKeys.Control | ModifierKeys.Shift); key = new KeyBinding(CancelCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM_TRUOC))) { KeyGesture keyg = new KeyGesture(Key.W, ModifierKeys.Control | ModifierKeys.Shift); key = new KeyBinding(PreviewCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM))) { KeyGesture keyg = new KeyGesture(Key.W, ModifierKeys.Control); key = new KeyBinding(ViewCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { KeyGesture keyg = new KeyGesture(Key.E, ModifierKeys.Shift); key = new KeyBinding(ExportCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TIM_KIEM))) { KeyGesture keyg = new KeyGesture(Key.S, ModifierKeys.Control | ModifierKeys.Shift); key = new KeyBinding(SearchCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { KeyGesture keyg = new KeyGesture(Key.F1, ModifierKeys.None); key = new KeyBinding(HelpCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { KeyGesture keyg = new KeyGesture(Key.Escape, ModifierKeys.None); key = new KeyBinding(CloseCommand, keyg); key.Gesture = keyg; } InputBindings.Add(key); } } }
/// <summary> /// Sự kiện hot key /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbHotKey_Click(object sender, RoutedEventArgs e) { RibbonButton tlb = (RibbonButton)sender; string strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAP_DU_LIEU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THEM))) { ClearForm(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAN_BAN))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU_TAM))) { BeforeSave(BusinessConstant.TrangThaiNghiepVu.LUU_TAM, BusinessConstant.TrangThaiBanGhi.SU_DUNG); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRINH_DUYET))) { BeforeSave(BusinessConstant.TrangThaiNghiepVu.CHO_DUYET, BusinessConstant.TrangThaiBanGhi.SU_DUNG); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.BANG_KE))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TU_CHOI_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THOAI_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM_TRUOC))) { OnPreview(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TIM_KIEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { onHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { CustomControl.CommonFunction.CloseUserControl(this); } }
/// <summary> /// Sự kiện shortcutkey /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnShortcutKey_Click(object sender, RoutedEventArgs e) { string strTinhNang = ((MenuItem)sender).Name.Substring(3, ((MenuItem)sender).Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAP_DU_LIEU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAN_BAN))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU_TAM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRINH_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.BANG_KE))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TU_CHOI_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THOAI_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM_TRUOC))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TIM_KIEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { onHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { CustomControl.CommonFunction.CloseUserControl(this); } }
/// <summary> /// Sự kiện hot key /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbHotKey_Click(object sender, RoutedEventArgs e) { RibbonButton tlb = (RibbonButton)sender; string strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAP_DU_LIEU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THEM))) { Them(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THUC_HIEN))) { Process(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { //Xoa(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAN_BAN))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU_TAM))) { //LuuDuLieu(BusinessConstant.TrangThaiBanGhi.SU_DUNG, BusinessConstant.TrangThaiNghiepVu.LUU_TAM, DatabaseConstant.Action.LUU_TAM); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRINH_DUYET))) { //LuuDuLieu(BusinessConstant.TrangThaiBanGhi.SU_DUNG, BusinessConstant.TrangThaiNghiepVu.CHO_DUYET, DatabaseConstant.Action.TRINH_DUYET); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.BANG_KE))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DUYET))) { //Duyet(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TU_CHOI_DUYET))) { //TuChoiDuyet(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THOAI_DUYET))) { //ThoaiDuyet(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM_TRUOC))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TIM_KIEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { onHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { CustomControl.CommonFunction.CloseUserControl(this); } }
/// <summary> /// Sự kiện hot key /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbHotKey_Click(object sender, RoutedEventArgs e) { //RibbonButton tlb = (RibbonButton)sender; string strTinhNang = ""; // tlb.Name.Substring(3, tlb.Name.Length - 3); if (sender is RibbonButton) { strTinhNang = ((RibbonButton)sender).Name.Substring(3, ((RibbonButton)sender).Name.Length - 3); } else { strTinhNang = ((MenuItem)sender).Name.Substring(3, ((MenuItem)sender).Name.Length - 3); } if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THEM))) { Them(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { Sua(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { BeforeDelete(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DUYET))) { BeforeApprove(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TU_CHOI_DUYET))) { BeforeRefuse(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THOAI_DUYET))) { BeforeCancel(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM))) { Xem(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TIM_KIEM))) { LoadDuLieu(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LAY_LAI))) { //TimKiem(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { XuatExcel(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { onHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { CustomControl.CommonFunction.CloseUserControl(this); } }
private void BindHotkey() { foreach (var child in Toolbar.Children) { if (child.GetType() == typeof(RibbonButton)) { RibbonButton tlb = (RibbonButton)child; KeyBinding key = new KeyBinding(); string strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THEM))) { KeyGesture keyg = new KeyGesture(Key.N, ModifierKeys.Control); key = new KeyBinding(AddCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { KeyGesture keyg = new KeyGesture(Key.M, ModifierKeys.Control); key = new KeyBinding(ModifyCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { KeyGesture keyg = new KeyGesture(Key.D, ModifierKeys.Control); key = new KeyBinding(DeleteCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DUYET))) { KeyGesture keyg = new KeyGesture(Key.A, ModifierKeys.Control | ModifierKeys.Shift); key = new KeyBinding(ApproveCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TU_CHOI_DUYET))) { KeyGesture keyg = new KeyGesture(Key.R, ModifierKeys.Control | ModifierKeys.Shift); key = new KeyBinding(RefuseCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THOAI_DUYET))) { KeyGesture keyg = new KeyGesture(Key.C, ModifierKeys.Control | ModifierKeys.Shift); key = new KeyBinding(CancelCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM))) { KeyGesture keyg = new KeyGesture(Key.W, ModifierKeys.Control); key = new KeyBinding(ViewCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TIM_KIEM))) { KeyGesture keyg = new KeyGesture(Key.F, ModifierKeys.Control); key = new KeyBinding(SearchCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LAY_LAI))) { KeyGesture keyg = new KeyGesture(Key.F5, ModifierKeys.None); key = new KeyBinding(ReloadCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { KeyGesture keyg = new KeyGesture(Key.E, ModifierKeys.Control | ModifierKeys.Shift); key = new KeyBinding(ExportCommand, keyg); key.Gesture = keyg; } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { KeyGesture keyg = new KeyGesture(Key.F1, ModifierKeys.None); key = new KeyBinding(HelpCommand, keyg); key.Gesture = keyg; } if (key != null) { InputBindings.Add(key); } } } }
/// <summary> /// Sự kiện hot key /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbHotKey_Click(object sender, RoutedEventArgs e) { // Truongnx string strTinhNang = ""; if (sender is RibbonButton) { RibbonButton tlb = (RibbonButton)sender; strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); } else if (sender is RibbonMenuItem) { RibbonMenuItem tlb = (RibbonMenuItem)sender; strTinhNang = tlb.Name.Substring(3, tlb.Name.Length - 3); } if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAP_DU_LIEU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.SUA))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XOA))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.NHAN_BAN))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.LUU_TAM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRINH_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.BANG_KE))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TU_CHOI_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.THOAI_DUYET))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM_TRUOC))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.XUAT_DU_LIEU))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TIM_KIEM))) { } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.TRO_GIUP))) { onHelp(); } else if (strTinhNang.Equals(DatabaseConstant.getValue(DatabaseConstant.Action.DONG))) { CustomControl.CommonFunction.CloseUserControl(this); } }