/// <summary> /// F1 リボン マスタ検索 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void OnF1Key(object sender, KeyEventArgs e) { try { var varCtl = FocusManager.GetFocusedElement(this); var varM01Text = ViewBaseCommon.FindVisualParent <M01_TOK_TextBox>(varCtl as UIElement); var ucTwinText = ViewBaseCommon.FindVisualParent <UcLabelTwinTextBox>(varCtl as UIElement); if (varM01Text != null) { varM01Text.OpenSearchWindow(this); } else if (ucTwinText != null) { // TwinTextboxのF1処理 switch (ucTwinText.DataAccessName) { case "M22_SOUK_BASYOC": SCHM22_SOUK souk = new SCHM22_SOUK(); souk.TwinTextBox = Warehouse; souk.確定コード = souk.TwinTextBox.Text1; if (souk.ShowDialog(this) == true) { Warehouse.Text1 = souk.TwinTextBox.Text1; // 倉庫コード Warehouse.Text2 = souk.TwinTextBox.Text3; // 倉庫略称名 } break; default: ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList); break; } } else { ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList); } } catch (Exception ex) { appLog.Error("検索画面起動エラー", ex); ErrorMessage = "システムエラーです。サポートへご連絡ください。"; } }
/// <summary> /// F1 マスタ検索 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void OnF1Key(object sender, KeyEventArgs e) { try { var ctl = FocusManager.GetFocusedElement(this); if (ctl is TextBox) { var uctext = ViewBaseCommon.FindVisualParent <UcTextBox>(ctl as UIElement); if (uctext == null) { return; } if (string.IsNullOrWhiteSpace(uctext.DataAccessName)) { ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList); return; } SCHM22_SOUK srch = new SCHM22_SOUK(); switch (uctext.DataAccessName) { case "M22_SOUK": srch.MultiSelect = true; break; default: srch.MultiSelect = false; break; } Framework.Windows.Controls.UcLabelTwinTextBox dmy = new Framework.Windows.Controls.UcLabelTwinTextBox(); srch.TwinTextBox = dmy; var ret = srch.ShowDialog(this); if (ret == true) { uctext.Text = srch.SelectedCodeList; FocusControl.SetFocusWithOrder(new TraversalRequest(FocusNavigationDirection.Next)); } } } catch (Exception ex) { appLog.Error("検索画面起動エラー", ex); ErrorMessage = "システムエラーです。サポートへご連絡ください。"; } }