/// <summary>
        /// F1 リボン マスタ検索
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF1Key(object sender, KeyEventArgs e)
        {
            try
            {
                object elmnt  = FocusManager.GetFocusedElement(this);
                var    spgrid = ViewBaseCommon.FindVisualParent <GcSpreadGrid>(elmnt as Control);

                if (spgrid != null)
                {
                    #region グリッドファンクションイベント
                    if (gridCtl.ActiveColumnIndex == (int)GridColumnsMapping.摘要)
                    {
                        // TODO:全角6文字を超える可能性アリ
                        SCHM11_TEK tek = new SCHM11_TEK();
                        tek.TwinTextBox = new UcLabelTwinTextBox();
                        if (tek.ShowDialog(this) == true)
                        {
                            gridCtl.SetCellValue(tek.TwinTextBox.Text2);
                        }
                    }

                    SearchDetail.Rows[gridCtl.ActiveRowIndex].EndEdit();

                    #endregion
                }
                else
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);

                    // 得意先の場合は個別に処理
                    // REMARKS:消費税関連の情報を取得する為
                    var twinText = ViewBaseCommon.FindVisualParent <M01_TOK_TextBox>(elmnt as Control);
                    if (twinText == null)
                    {
                        return;
                    }

                    if (twinText.Name == this.txt得意先.Name)
                    {
                        txt得意先.OpenSearchWindow(this);
                    }
                    else if (twinText.Name == this.txt仕入先.Name)
                    {
                        txt仕入先.OpenSearchWindow(this);
                    }
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                this.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;
                    }
                    SCHM11_TEK srch = new SCHM11_TEK();
                    switch (uctext.DataAccessName)
                    {
                    case "M11_TEK":
                        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 = "システムエラーです。サポートへご連絡ください。";
            }
        }
Exemple #3
0
        /// <summary>
        /// F1 リボン マスタ検索
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF1Key(object sender, KeyEventArgs e)
        {
            try
            {
                object elmnt   = FocusManager.GetFocusedElement(this);
                var    spgrid  = ViewBaseCommon.FindVisualParent <GcSpreadGrid>(elmnt as Control);
                var    tok_ctl = ViewBaseCommon.FindVisualParent <M01_TOK_TextBox>(elmnt as Control);

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

                    #region グリッドファンクションイベント
                    if (spgrid.ActiveColumnIndex == GridColumnsMapping.摘要.GetHashCode())
                    {
                        SCHM11_TEK tek = new SCHM11_TEK();
                        tek.TwinTextBox = new UcLabelTwinTextBox();
                        if (tek.ShowDialog(this) == true)
                        {
                            spgrid.Cells[rIdx, cIdx].Value = tek.TwinTextBox.Text2;
                        }
                    }

                    SearchDetail.Rows[rIdx].EndEdit();

                    #endregion
                }
                else if (tok_ctl != null)
                {
                    this.txt得意先.OpenSearchWindow(this);
                }
                else
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
        /// <summary>
        /// F1 リボン マスタ参照
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF1Key(object sender, KeyEventArgs e)
        {
            try
            {
                object elmnt  = FocusManager.GetFocusedElement(this);
                var    spgrid = ViewBaseCommon.FindVisualParent <GcSpreadGrid>(elmnt as Control);

                if (spgrid == null)
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
                else
                {
                    #region スプレッド内のイベント処理

                    if (gridCtl.ActiveColumnIndex == GridColumnsMapping.摘要.GetHashCode())
                    {
                        // TODO:全角6文字を超える可能性アリ
                        SCHM11_TEK tek = new SCHM11_TEK();
                        tek.TwinTextBox = new UcLabelTwinTextBox();
                        if (tek.ShowDialog(this) == true)
                        {
                            gridCtl.SetCellValue(tek.TwinTextBox.Text2);
                        }
                    }

                    SearchDetail.Rows[gridCtl.ActiveRowIndex].EndEdit();

                    #endregion
                }
            }
            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
            {
                object elmnt  = FocusManager.GetFocusedElement(this);
                var    spgrid = ViewBaseCommon.FindVisualParent <GcSpreadGrid>(elmnt as Control);

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

                    #region グリッドファンクションイベント
                    if (spgrid.ActiveColumnIndex == (int)GridColumnsMapping.自社品番)
                    {
                        // 対象セルがロックされている場合は処理しない
                        if (spgrid.Cells[rIdx, cIdx].Locked == true)
                        {
                            return;
                        }

                        // 自社品番または得意先品番の場合
                        SCHM09_MYHIN myhin = new SCHM09_MYHIN();
                        myhin.txtCode.Text         = spgrid.Cells[rIdx, cIdx].Value == null ? string.Empty : spgrid.Cells[rIdx, cIdx].Value.ToString();
                        myhin.TwinTextBox          = new UcLabelTwinTextBox();
                        myhin.TwinTextBox.LinkItem = 1;

                        if (myhin.ShowDialog(this) == true)
                        {
                            //入力途中のセルを未編集状態に戻す
                            spgrid.CancelCellEdit();

                            spgrid.Cells[rIdx, (int)GridColumnsMapping.品番コード].Value = myhin.SelectedRowData["品番コード"].ToString();
                            spgrid.Cells[rIdx, (int)GridColumnsMapping.自社品番].Value  = myhin.SelectedRowData["自社品番"].ToString();
                            spgrid.Cells[rIdx, (int)GridColumnsMapping.自社品名].Value  = myhin.SelectedRowData["自社品名"].ToString();
                            spgrid.Cells[rIdx, (int)GridColumnsMapping.数量].Value    = 1m;
                            spgrid.Cells[rIdx, (int)GridColumnsMapping.消費税区分].Value = myhin.SelectedRowData["消費税区分"];
                            spgrid.Cells[rIdx, (int)GridColumnsMapping.商品分類].Value  = myhin.SelectedRowData["商品分類"];

                            //20190624CB-S
                            spgrid.Cells[rIdx, (int)GridColumnsMapping.色コード].Value = myhin.SelectedRowData["自社色"];
                            spgrid.Cells[rIdx, (int)GridColumnsMapping.色名称].Value  = myhin.SelectedRowData["自社色名"];
                            //20190624CB-E

                            // 設定自社品番の編集を不可とする
                            spgrid.Cells[rIdx, cIdx].Locked = true;
                        }
                    }
                    else if (spgrid.ActiveColumnIndex == (int)GridColumnsMapping.摘要)
                    {
                        SCHM11_TEK tek = new SCHM11_TEK();
                        tek.TwinTextBox = new UcLabelTwinTextBox();
                        if (tek.ShowDialog(this) == true)
                        {
                            spgrid.Cells[rIdx, cIdx].Value = tek.TwinTextBox.Text2;
                        }
                    }

                    SearchDetail.Rows[rIdx].EndEdit();

                    #endregion
                }
                else
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }