Beispiel #1
0
        /// <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);
                var spgrid  = ViewBaseCommon.FindVisualParent <GcSpreadGrid>(ctl as Control);
                var m01Text = ViewBaseCommon.FindVisualParent <M01_TOK_TextBox>(ctl as UIElement);

                if (spgrid != null)
                {
                    int cIdx = spgrid.ActiveColumnIndex;
                    int rIdx = spgrid.ActiveRowIndex;

                    if (spgrid.ActiveColumnIndex == GridColumnsMapping.支払担当者コード.GetHashCode() || spgrid.ActiveColumnIndex == GridColumnsMapping.請求担当者コード.GetHashCode())
                    {
                        SCHM72_TNT TNT = new SCHM72_TNT();
                        TNT.TwinTextBox = new UcLabelTwinTextBox();
                        if (TNT.ShowDialog(this) == true)
                        {
                            //担当者ID
                            spgrid.Cells[rIdx, cIdx].Value = TNT.TwinTextBox.Text1;
                            //担当者名
                            spgrid.Cells[rIdx, cIdx + 1].Value = TNT.TwinTextBox.Text2;

                            //更新用DataTableに反映
                            string targetColumn = spgrid.ActiveCellPosition.ColumnName;
                            SearchResult.Rows[rIdx][targetColumn] = spgrid.Cells[rIdx, cIdx].Value;
                        }
                    }
                }
                else if (m01Text == null)
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
                else
                {
                    m01Text.OpenSearchWindow(this);
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Beispiel #2
0
        /// <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;
                    }
                    SCHM72_TNT srch = new SCHM72_TNT();
                    switch (uctext.DataAccessName)
                    {
                    case "M72_TNT":
                        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 = "システムエラーです。サポートへご連絡ください。";
            }
        }