Ejemplo n.º 1
0
 /// <summary>
 /// F02 リボン マスタ編集
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public override void OnF2Key(object sender, KeyEventArgs e)
 {
     try
     {
         var elmnt  = FocusManager.GetFocusedElement(this);
         var spgrid = ViewBaseCommon.FindVisualParent <GcSpreadGrid>(elmnt as Control);
         if (spgrid != null)
         {
             if (spgrid.ActiveColumnIndex == GridColumnsMapping.自社品番.GetHashCode())
             {
                 // 品番マスタ表示
                 MST02010 M09Form = new MST02010();
                 M09Form.Show(this);
             }
         }
         else
         {
             ViewBaseCommon.CallMasterMainte(this.MasterMaintenanceWindowList);
         }
     }
     catch (Exception ex)
     {
         appLog.Error("マスターメンテナンス画面起動エラー", ex);
         this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 自社品番(入庫)でキーが押された時のイベント処理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txt自社品番_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter || e.Key == Key.Tab)
            {
                string p自社品番 = string.Empty;

                var ctl    = FocusManager.GetFocusedElement(this);
                var uctext = ViewBaseCommon.FindVisualParent <UcLabelTwinTextBox>(ctl as UIElement);

                // テキストボックス名で入庫か出庫を判定
                if (uctext.Name == this.txt出庫自社品番.Name)
                {
                    p自社品番  = this.txt出庫自社品番.Text1;
                    入出庫フラグ = 2;
                }
                else if (uctext.Name == this.txt入庫自社品番.Name)
                {
                    p自社品番  = this.txt入庫自社品番.Text1;
                    入出庫フラグ = 1;
                }

                // 自社品番(または得意先品番)からデータを参照し、取得内容をテキストボックスに設定
                base.SendRequest(
                    new CommunicationObject(
                        MessageType.RequestData,
                        GetMyProduct,
                        new object[] {
                    p自社品番
                    , null
                    , null
                }));
            }
        }
Ejemplo n.º 3
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 m01Text = ViewBaseCommon.FindVisualParent <M01_TOK_TextBox>(ctl as UIElement);

                if (m01Text == null)
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
                else
                {
                    // No.199 Add Start
                    if (this.rdoUrisaki.Text == 売上先.得意先.GetHashCode().ToString())
                    {
                        // 得意先、相殺
                        m01Text.LinkItem = "0,3";
                    }
                    else
                    {
                        // 販社
                        m01Text.LinkItem = "4";
                    }
                    // No.199 Add End

                    m01Text.OpenSearchWindow(this);
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// F1 マスタ検索
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF1Key(object sender, KeyEventArgs e)
        {
            object elmnt = FocusManager.GetFocusedElement(this);

            var spgrid = ViewBaseCommon.FindVisualParent <GcSpreadGrid>(elmnt as Control);

            if (spgrid != null)
            {
                int actrow = spgrid.ActiveRowIndex;
                if (spgrid.ActiveColumn.Name == "摘要ID")
                {
                    Framework.Windows.Controls.UcLabelTwinTextBox dmy = new Framework.Windows.Controls.UcLabelTwinTextBox();
                    SCH08010 srch = new SCH08010();
                    srch.TwinTextBox = dmy;

                    if (srch.ShowDialog(this) == true)
                    {
                        spgrid.Cells[actrow, "摘要ID"].Text = dmy.Text1;
                        int sid = AppCommon.IntParse(dmy.Text1);
                        base.SendRequest(new CommunicationObject(MessageType.RequestData, GetTekiyoName, sid, spgrid.ActiveRow.Index));
                    }
                }
            }
            else
            {
                ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
            }
        }
Ejemplo n.º 5
0
        private void UcLabelTextBox_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                try
                {
                    try
                    {
                        var uctxt = ViewBaseCommon.FindLogicalChildList <UcTextBox>(sender as DependencyObject).FirstOrDefault();
                        uctxt.ApplyFormat();
                        DateTime dt = Convert.ToDateTime(uctxt.Text);
                        集計期間To = dt;
                    }
                    catch (Exception)
                    {
                    }
                    var uctxt1 = ViewBaseCommon.FindLogicalChildList <UcTextBox>(sender as DependencyObject).FirstOrDefault();
                    uctxt1.ApplyFormat();
                    DateTime dt1 = Convert.ToDateTime(uctxt1.Text);
                    集計期間To = dt1;
                }
                catch (Exception)
                {
                }
                var yesno = MessageBox.Show("プレビューを表示しますか?", "確認", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes);
                if (yesno == MessageBoxResult.No)
                {
                    return;
                }

                OnF8Key(sender, null);
            }
        }
Ejemplo n.º 6
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;
                }
                else if (tok_ctl != null)
                {
                    this.txt得意先.OpenSearchWindow(this);
                }
                else
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// F1 リボン マスタ参照
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF1Key(object sender, KeyEventArgs e)
        {
            // フォーカスコントロールを取得
            IInputElement ctl    = Keyboard.FocusedElement;
            object        elmnt  = FocusManager.GetFocusedElement(this);
            var           tokBox = ViewBaseCommon.FindVisualParent <M01_TOK_TextBox>(elmnt as Control);
            var           ucText = ViewBaseCommon.FindVisualParent <UcLabelTwinTextBox>(elmnt as Control);

            if (tokBox != null)
            {
                // 取引先テキストの場合
                tokBox.OpenSearchWindow(this);
            }
            // No-380 Add Start
            else if (ucText != null)
            {
                switch (ucText.DataAccessName)
                {
                case "M09_MYHIN":

                    SCHM09_MYHIN myhin = new SCHM09_MYHIN();
                    myhin.TwinTextBox          = new UcLabelTwinTextBox();
                    myhin.txtCode.Text         = HINBAN.Text1;
                    myhin.TwinTextBox.LinkItem = 1;

                    if (myhin.ShowDialog(this) == true)
                    {
                        this.HINBAN.Text1 = myhin.SelectedRowData["自社品番"].ToString();
                        this.HINBAN.Text2 = myhin.SelectedRowData["自社品名"].ToString();
                        this.COLOR.Text1  = myhin.SelectedRowData["自社色"].ToString();
                        this.COLOR.Focus();
                    }
                    break;

                default:
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                    break;
                }
            }
            // No-380 Add End
            else if (ctl is DataGridCell)
            {
                /*
                 * TODO:品番検索を開こうかと思ったけど行追加の場合だけでよい気がしたので保留
                 */
            }
            else
            {
                try
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
                catch (Exception ex)
                {
                    appLog.Error("検索画面起動エラー", ex);
                    this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
                }
            }
        }
Ejemplo n.º 8
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);
                if (spgrid != null)
                {
                    int actrow = spgrid.ActiveRowIndex;
                    spgrid.CommitCellEdit();

                    UcLabelTwinTextBox dmy = new UcLabelTwinTextBox();
                    switch (spgrid.ActiveColumn.Name)
                    {
                    case "材料品番":
                        var          val   = spComponent.Cells[spComponent.ActiveRowIndex, spgrid.ActiveColumn.Name].Value;
                        SCHM09_MYHIN myHin = new SCHM09_MYHIN();
                        myHin.chkItemClass_1.IsChecked = false;
                        myHin.chkItemClass_1.IsEnabled = false;
                        myHin.TwinTextBox = dmy;
                        if (myHin.ShowDialog(this) ?? false)
                        {
                            SpreadGridRow row = spComponent.Rows[spComponent.ActiveRowIndex];

                            int myCode = (int)myHin.SelectedRowData["品番コード"];
                            int cnt    = SetKouseihin.Where(x => x.品番コード == myCode).Count();
                            if (cnt > 0)
                            {
                                MessageBox.Show("同じ材料品番が既に登録されています。");
                                return;
                            }

                            row.Cells[0].Value = myHin.SelectedRowData["品番コード"].ToString();
                            row.Cells[2].Value = myHin.SelectedRowData["自社品番"].ToString();
                            row.Cells[3].Value = myHin.SelectedRowData["自社色"].ToString();
                            row.Cells[4].Value = myHin.SelectedRowData["自社色名"].ToString();
                            row.Cells[5].Value = myHin.SelectedRowData["自社品名"].ToString();

                            NotifyPropertyChanged();
                        }
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 取得データの取り込み
        /// </summary>
        /// <param name="message"></param>
        public override void OnReceivedResponseData(CommunicationObject message)
        {
            var       data = message.GetResultData();
            DataTable tbl  = (data is DataTable) ? (data as DataTable) : null;

            switch (message.GetMessageName())
            {
            case MST01011_GetDataList:
                base.SetFreeForInput();
                if (tbl.Rows.Count > 0)
                {
                    SearchResult = tbl;
                    DataSet ds = new DataSet();
                    ds.Tables.Add(SearchResult);
                    SetData(tbl);
                }
                else
                {
                    this.ErrorMessage = "対象データが存在しません。";
                    return;
                }

                break;

            case MST01011_Update:
                if ((int)data == 1)
                {
                    MessageBox.Show("更新完了しました。");
                }

                ScreenClear();
                break;

            case MST01011_GetM72:
                var ctl    = FocusManager.GetFocusedElement(this);
                var spgrid = ViewBaseCommon.FindVisualParent <GcSpreadGrid>(ctl as Control);
                if (spgrid == null)
                {
                    return;
                }

                //担当者名を表示
                if (data != null)
                {
                    spgrid.Cells[targetRowIdx, targetColIdx + 1].Value = data.ToString();
                }
                else
                {
                    spgrid.Cells[targetRowIdx, targetColIdx].Value     = null;
                    spgrid.Cells[targetRowIdx, targetColIdx + 1].Value = string.Empty;
                }

                break;
            }
        }
Ejemplo n.º 10
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);

                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 = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 11
0
 /// <summary>
 /// F2 マスタメンテ
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public override void OnF2Key(object sender, KeyEventArgs e)
 {
     try
     {
         ViewBaseCommon.CallMasterMainte(this.MasterMaintenanceWindowList);
     }
     catch (Exception ex)
     {
         appLog.Error("マスターメンテ画面起動エラー", ex);
         this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
     }
 }
Ejemplo n.º 12
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    twintxt = ViewBaseCommon.FindVisualParent <UcLabelTwinTextBox>(elmnt as Control);

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

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

                        // 自社品番の場合
                        SCHM09_MYHIN myhin = new SCHM09_MYHIN();
                        myhin.TwinTextBox          = new UcLabelTwinTextBox();
                        myhin.TwinTextBox.LinkItem = 1;
                        if (myhin.ShowDialog(this) == true)
                        {
                            spgrid.Cells[rIdx, GridColumnsMapping.品番コード.GetHashCode()].Value = myhin.SelectedRowData["品番コード"];
                            spgrid.Cells[rIdx, GridColumnsMapping.自社品番.GetHashCode()].Value  = myhin.SelectedRowData["自社品番"];
                            spgrid.Cells[rIdx, GridColumnsMapping.自社品名.GetHashCode()].Value  = myhin.SelectedRowData["自社品名"];
                            spgrid.Cells[rIdx, GridColumnsMapping.数量.GetHashCode()].Value    = 1m;
                            spgrid.Cells[rIdx, GridColumnsMapping.単位.GetHashCode()].Value    = myhin.SelectedRowData["単位"];
                        }
                    }

                    SearchDetail.Rows[rIdx].EndEdit();

                    #endregion
                }
                else
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 13
0
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);
            this.Enabled = true;
            System.Windows.Input.Mouse.OverrideCursor = null;

            crviewToolbar = ViewBaseCommon.FindLogicalChildList <System.Windows.Controls.ToolBar>(this.CRVIEWER as System.Windows.DependencyObject).First();
            crviewToolbar.Items.Clear();

            if (btnPrintOut != null)
            {
                AppLogger.Instance.Debug("btnPrintOut is alive");
                btnPrintOut.Click -= ReportPreviewPrintButton_Click;
                btnPrintOut        = null;
            }
            if (btnClose != null)
            {
                AppLogger.Instance.Debug("btnClose is alive");
                btnClose.Click -= closebtn_Click;
                btnClose        = null;
            }
            if (cboxCustom != null)
            {
                AppLogger.Instance.Debug("cboxCustom is alive");
                cboxCustom.Checked   -= cbox_Checked;
                cboxCustom.UnChecked -= cbox_Unchecked;
                cboxCustom            = null;
            }
            if (targetReportDocument != null)
            {
                AppLogger.Instance.Debug("targetReportDocument is alive");
                targetReportDocument.Close();
                targetReportDocument.Dispose();
                targetReportDocument = null;
            }
            if (_ReportData is DataTable)
            {
                (_ReportData as DataTable).Dispose();
            }
            else if (_ReportData is DataSet)
            {
                var ds = (_ReportData as DataSet);
                foreach (DataTable tbl in ds.Tables)
                {
                    tbl.Dispose();
                }
                ds.Tables.Clear();
                ds.Dispose();
            }
            _ReportData = null;
        }
Ejemplo n.º 14
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;
                    }
                    SCH06010 srch = new SCH06010();
                    switch (uctext.DataAccessName)
                    {
                    case "M05_CAR":
                        srch.MultiSelect = false;
                        break;

                    case "M71_BUM":
                        srch.MultiSelect = false;
                        break;

                    default:
                        srch.MultiSelect = true;
                        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 = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// F2 マスタメンテ
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF2Key(object sender, KeyEventArgs e)
        {
            base.SendRequest(new CommunicationObject(MessageType.RequestData, TargetTableNm, new object[] { 1, 0 }));
            base.SendRequest(new CommunicationObject(MessageType.RequestData, SyukinTableNm, new object[] { 1, 0 }));

            try
            {
                ViewBaseCommon.CallMasterMainte(this.MasterMaintenanceWindowList);
            }
            catch (Exception ex)
            {
                appLog.Error("マスターメンテ画面起動エラー", ex);
                this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// F02 リボン マスタ編集
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF2Key(object sender, KeyEventArgs e)
        {
            try
            {
                var elmnt   = FocusManager.GetFocusedElement(this);
                var spgrid  = ViewBaseCommon.FindVisualParent <GcSpreadGrid>(elmnt as Control);
                var m01Text = ViewBaseCommon.FindVisualParent <M01_TOK_TextBox>(elmnt as Control);

                if (spgrid != null)
                {
                    #region スプレッド内のイベント処理

                    switch (spgrid.ActiveColumnIndex)
                    {
                    case (int)GridColumnsMapping.取引先コード:
                    case (int)GridColumnsMapping.枝番:
                        MST01010 M01Form = new MST01010();
                        M01Form.Show(this);
                        break;

                    case (int)GridColumnsMapping.自社品番:
                        MST02010 M09Form = new MST02010();
                        M09Form.Show(this);

                        break;

                    default:
                        break;
                    }

                    #endregion
                }
                else if (m01Text != null)
                {
                    MST01010 m01Form = new MST01010();
                    m01Form.Show(this);
                }
                else
                {
                    ViewBaseCommon.CallMasterMainte(this.MasterMaintenanceWindowList);
                }
            }
            catch (Exception ex)
            {
                appLog.Error("マスターメンテナンス画面起動エラー", ex);
                this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 17
0
        /// <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 = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 18
0
 /// <summary>
 /// F1 リボン 検索
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public override void OnF1Key(object sender, KeyEventArgs e)
 {
     //検索処理
     //IDにカーソルがある場合に作動
     //xaml側のIDの方でDataAccessNameの記述が必要!
     //LoadedにもSCH画面の追加する一行を記述する!
     try
     {
         ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
     }
     catch (Exception ex)
     {
         appLog.Error("検索画面起動エラー", ex);
         this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
     }
 }
Ejemplo n.º 19
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 uctext = ViewBaseCommon.FindVisualParent <UcLabelTwinTextBox>(ctl as UIElement);

                if (uctext != null && uctext.DataAccessName == "M09_MYHIN")
                {
                    SCHM09_MYHIN myhin = new SCHM09_MYHIN();
                    myhin.txtCode.Text         = uctext.Text1;
                    myhin.TwinTextBox          = new UcLabelTwinTextBox();
                    myhin.TwinTextBox.LinkItem = 0;
                    if (myhin.ShowDialog(this) == true)
                    {
                        // テキストボックス名で入庫か出庫を判定
                        if (uctext.Name == this.txt出庫自社品番.Name)
                        {
                            txt出庫自社品番.Text1          = myhin.SelectedRowData["自社品番"].ToString();
                            txt出庫自社品番.Text2          = myhin.SelectedRowData["自社品名"].ToString();
                            OutSearchDetail["品番コード"] = myhin.SelectedRowData["品番コード"].ToString();
                            OutSearchDetail["商品分類"]  = int.Parse(myhin.SelectedRowData["商品分類"].ToString());
                            出庫自社色情報 = myhin.SelectedRowData["自社色"].ToString() + " " + myhin.SelectedRowData["自社色名"].ToString();
                            txt出庫賞味期限.Focus();
                        }
                        else if (uctext.Name == this.txt入庫自社品番.Name)
                        {
                            txt入庫自社品番.Text1         = myhin.SelectedRowData["自社品番"].ToString();
                            txt入庫自社品番.Text2         = myhin.SelectedRowData["自社品名"].ToString();
                            InSearchDetail["品番コード"] = int.Parse(myhin.SelectedRowData["品番コード"].ToString());
                            InSearchDetail["商品分類"]  = int.Parse(myhin.SelectedRowData["商品分類"].ToString());
                            入庫自社色情報 = myhin.SelectedRowData["自社色"].ToString() + " " + myhin.SelectedRowData["自社色名"].ToString();
                            txt入庫賞味期限.Focus();
                        }
                    }
                }
                else
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 20
0
 private void UcLabelTextBox_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         try
         {
             var uctxt = ViewBaseCommon.FindLogicalChildList <UcTextBox>(sender as DependencyObject).FirstOrDefault();
             uctxt.ApplyFormat();
             DateTime dt = Convert.ToDateTime(uctxt.Text);
             集計期間To = dt;
         }
         catch (Exception)
         {
         }
         OnF8Key(sender, null);
     }
 }
Ejemplo n.º 21
0
        /// <summary>
        /// 自社品番が変更された時のイベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void 自社品番_cText1Changed(object sender, RoutedEventArgs e)
        {
            var ctl    = FocusManager.GetFocusedElement(this);
            var uctext = ViewBaseCommon.FindVisualParent <UcLabelTwinTextBox>(ctl as UIElement);

            // テキストボックス名で入庫か出庫を判定
            if (uctext.Name == this.txt出庫自社品番.Name)
            {
                txt出庫自社品番.Text2 = string.Empty;
                出庫自社色情報         = string.Empty;
            }
            else if (uctext.Name == this.txt入庫自社品番.Name)
            {
                txt入庫自社品番.Text2 = string.Empty;
                入庫自社色情報         = string.Empty;
            }
        }
Ejemplo n.º 22
0
            /// <summary>
            /// 確定ボタン押下
            /// </summary>
            /// <param name="parameter"></param>
            public void Execute(object parameter)
            {
                CellCommandParameter cellCommandParameter = (CellCommandParameter)parameter;
                var    parent = ViewBaseCommon.FindVisualParent <TKS90010>(this._gcSpreadGrid);
                string msg    = string.Empty;

                if (cellCommandParameter.Area == SpreadArea.Cells)
                {
                    int rowNo     = cellCommandParameter.CellPosition.Row;
                    var row       = this._gcSpreadGrid.Rows[rowNo];
                    var fixKbn    = row.Cells[(int)GridColumnsMapping.確定区分].Value;
                    var fixDay    = row.Cells[(int)GridColumnsMapping.確定日].Value;
                    var closeDay  = row.Cells[(int)GridColumnsMapping.締日].Value;
                    var toriKbn   = row.Cells[(int)GridColumnsMapping.取引区分ID].Value;
                    var toriKbnNm = row.Cells[(int)GridColumnsMapping.取引区分].Value;
                    var jisCode   = row.Cells[(int)GridColumnsMapping.自社コード].Value;

                    // エラー情報をクリア
                    row.ValidationErrors.Clear();

                    if (fixDay == null || fixDay.ToString() == DEFAULT_YYMMDD)
                    {
                        msg = "確定日を設定してください。";
                        CellPosition cp = new CellPosition(rowNo, GridColumnsMapping.確定日.GetHashCode());
                        this._gcSpreadGrid[cp].ValidationErrors.Add(new SpreadValidationError(msg, null));
                        MessageBox.Show(msg);
                        return;
                    }

                    if (MessageBox.Show(
                            string.Format("{0}日締の{1}を {2} で確定登録します。\n確定日以前の伝票は編集できなくなります。\nよろしいですか?"
                                          , closeDay.ToString()
                                          , toriKbnNm.ToString()
                                          , fixDay.ToString()),
                            "登録確認",
                            MessageBoxButton.YesNo,
                            MessageBoxImage.Question,
                            MessageBoxResult.Yes) == MessageBoxResult.No)
                    {
                        return;
                    }

                    // 登録処理を呼び出し
                    parent.UpdateTableData(jisCode.ToString(), fixKbn.ToString(), closeDay.ToString(), fixDay.ToString(), toriKbn.ToString());
                }
            }
Ejemplo n.º 23
0
        /// <summary>
        /// F02 リボン マスタ編集
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnF2Key(object sender, KeyEventArgs e)
        {
            try
            {
                var elmnt  = FocusManager.GetFocusedElement(this);
                var spgrid = ViewBaseCommon.FindVisualParent <GcSpreadGrid>(elmnt as Control);
                if (spgrid != null)
                {
                    #region スプレッド内のイベント処理

                    if (gridCtl.ActiveColumnIndex == (int)GridColumnsMapping.摘要)
                    {
                        // 摘要マスタ表示
                        MST08010 M11Form = new MST08010();
                        M11Form.Show(this);
                    }

                    #endregion
                }
                else
                {
                    var twinText = ViewBaseCommon.FindVisualParent <M01_TOK_TextBox>(elmnt as Control);

                    if (twinText == null)
                    {
                        ViewBaseCommon.CallMasterMainte(this.MasterMaintenanceWindowList);
                    }

                    else
                    {
                        // 取引先画面の表示
                        MST01010 mstForm = new MST01010();
                        mstForm.TORI_CODE.Text = twinText.Text1;
                        mstForm.TORI_EDA.Text  = twinText.Text2;

                        mstForm.ShowDialog(this);
                    }
                }
            }
            catch (Exception ex)
            {
                appLog.Error("マスターメンテナンス画面起動エラー", ex);
                this.ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 24
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 = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 25
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 = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 26
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 tokText = ViewBaseCommon.FindVisualParent <M01_TOK_TextBox>(ctl as UIElement);

                if (tokText == null)
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
                else
                {
                    tokText.OpenSearchWindow(this);
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 27
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 uTwin = ViewBaseCommon.FindVisualParent <UcLabelTwinTextBox>(ctl as UIElement);

                if (uTwin == null)
                {
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
                else
                {
                    // 商品コード指定
                    if (uTwin.DataAccessName == "M09_MYHIN")
                    {
                        // 雑コード非表示
                        int[]        disableItem = new [] { 3 };
                        SCHM09_MYHIN myhin       = new SCHM09_MYHIN(disableItem);
                        myhin.TwinTextBox = uTwin;
                        if (myhin.ShowDialog(this) == true)
                        {
                            this.Product.Text1 = myhin.SelectedRowData["自社品番"].ToString();
                            this.Product.Text2 = myhin.SelectedRowData["自社品名"].ToString();
                        }
                    }
                    else
                    {
                        ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                    }
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 28
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    tokBox = ViewBaseCommon.FindVisualParent <M01_TOK_TextBox>(elmnt as Control);

                if (tokBox != null)
                {
                    // 取引先テキストの場合
                    tokBox.OpenSearchWindow(this);
                }
                else if (isFocusedSupCode)
                {
                    // 取引先の場合、別テキストに枝番設定の為独自処理
                    SCHM01_TOK di = new SCHM01_TOK();
                    di.TwinTextBox = new Framework.Windows.Controls.UcLabelTwinTextBox();

                    if (di.ShowDialog(this) == true)
                    {
                        this.TORI_CODE.Text = di.TwinTextBox.Text1;
                        this.TORI_EDA.Text  = di.TwinTextBox.Text2;

                        SearchSupplierData(int.Parse(取引先コード), int.Parse(枝番));
                    }
                }
                else
                {
                    // 取引先以外はFW標準で開く
                    ViewBaseCommon.CallMasterSearch(this, this.MasterMaintenanceWindowList);
                }
            }
            catch (Exception ex)
            {
                appLog.Error("検索画面起動エラー", ex);
                ErrorMessage = "システムエラーです。サポートへご連絡ください。";
            }
        }
Ejemplo n.º 29
0
            public void Execute(object parameter)
            {
                CellCommandParameter cellCommandParameter = (CellCommandParameter)parameter;

                if (cellCommandParameter.Area == SpreadArea.Cells)
                {
                    int rowNo = cellCommandParameter.CellPosition.Row;
                    var row   = this._gcSpreadGrid.Rows[rowNo];
                    var mNo   = row.Cells[this._gcSpreadGrid.Columns["明細番号"].Index].Value;
                    var wnd   = GetWindow(this._gcSpreadGrid);

                    DLY09010 frm = new DLY09010();
                    frm.初期明細番号 = (int?)mNo;
                    frm.ShowDialog(wnd);

                    if (frm.IsUpdated)
                    {
                        // 日報側で更新された場合、再検索を実行する
                        var parent = ViewBaseCommon.FindVisualParent <DLY16010>(this._gcSpreadGrid);
                        parent.Button_Click_1(null, null);
                    }
                }
            }
Ejemplo n.º 30
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);

                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 = "システムエラーです。サポートへご連絡ください。";
            }
        }