private void txtReceiptDivisionId_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            beforeValueDlg = "";
            if (_entityListD.Count >= DataForm.CurrentIndex)
            {
                beforeValueDlg = _entityListD[DataForm.CurrentIndex]._payment_cash_division_id;
            }

            if (_txtReceiptDivisionId == null)
            {
                _txtReceiptDivisionId = ExVisualTreeHelper.FindTextBox(this.DataForm, "txtReceiptDivisionId");
            }

            Dlg_MstSearch searchDlg = new Dlg_MstSearch();
            searchDlg.MstKbn = MstData.geMDataKbn.RecieptDivision;
            searchDlg.Show();
            searchDlg.Closed += searchDlg_Closed;
        }
 private void btnSalesBalance_Click(object sender, RoutedEventArgs e)
 {
     Dlg_MstSearch searchDlg = new Dlg_MstSearch(MstData.geMDataKbn.PaymentBalance);
     searchDlg.MstKbn = Class.Data.MstData.geMDataKbn.PaymentBalance;
     searchDlg.MstGroupKbn = Class.Data.MstData.geMGroupKbn.None;
     searchDlg.txtCode.Text = this.utlID.txtID.Text.Trim();
     searchDlg.Show();
 }
        private void btnSalesBalance_Click(object sender, RoutedEventArgs e)
        {
            if (this._entityH == null)
            {
                ExMessageBox.Show("得意先を選択して下さい。");
                return;
            }

            if (string.IsNullOrEmpty(this._entityH._invoice_id) || this._entityH._invoice_id == "0")
            {
                ExMessageBox.Show("得意先を選択して下さい。");
                return;
            }

            Dlg_MstSearch searchDlg = new Dlg_MstSearch(MstData.geMDataKbn.SalesBalance);
            searchDlg.MstKbn = Class.Data.MstData.geMDataKbn.SalesBalance;
            searchDlg.MstGroupKbn = Class.Data.MstData.geMGroupKbn.None;
            searchDlg.txtCode.Text = ExCast.zNumZeroNothingFormat(this._entityH._invoice_id);
            searchDlg.Show();

        }
        private void btnInventory_Click(object sender, RoutedEventArgs e)
        {
            if (ExCast.zCStr(_entityListD[dg.SelectedIndex]._commodity_id) != "" && ExCast.zCInt(_entityListD[dg.SelectedIndex]._inventory_management_division_id) == 1)
            {
            }
            else
            {
                ExMessageBox.Show("商品を選択して下さい。");
                return;
            }

            Dlg_MstSearch searchDlg = new Dlg_MstSearch(MstData.geMDataKbn.Inventory);
            searchDlg.MstKbn = Class.Data.MstData.geMDataKbn.Inventory;
            searchDlg.MstGroupKbn = Class.Data.MstData.geMGroupKbn.None;
            searchDlg.txtCode.Text = ExCast.zNumZeroNothingFormat(ExCast.zCStr(_entityListD[dg.SelectedIndex]._commodity_id));
            searchDlg.Show();
        }
        private void btnSalesBalance_Click(object sender, RoutedEventArgs e)
        {
            if (this._entityH == null)
            {
                ExMessageBox.Show("仕入先を選択して下さい。");
                return;
            }

            Dlg_MstSearch searchDlg = new Dlg_MstSearch(MstData.geMDataKbn.PaymentBalance);
            searchDlg.MstKbn = Class.Data.MstData.geMDataKbn.PaymentBalance;
            searchDlg.MstGroupKbn = Class.Data.MstData.geMGroupKbn.None;
            searchDlg.txtCode.Text = ExCast.zNumZeroNothingFormat(this._entityH._purchase_id);
            searchDlg.Show();
        }
        private void txtGoodsID_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            _selectIndex = dg.SelectedIndex;
            _selectColumn = dg.CurrentColumn.DisplayIndex;
            beforeValue = "";
            if (_entityListD == null) return;
            if (_entityListD.Count >= _selectIndex)
            {
                beforeValue = _entityListD[_selectIndex]._commodity_id;
            }

            masterDlg = new Dlg_MstSearch();
            masterDlg.MstKbn = MstData.geMDataKbn.Commodity;
            masterDlg.Show();
            masterDlg.Closed += masterDlg_Closed;
        }
        private void txtReceiptDivisionId_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            _selectIndex = dg.SelectedIndex;
            _selectColumn = dg.CurrentColumn.DisplayIndex;
            beforeValue = "";
            if (_entityListD == null) return;
            if (_entityListD.Count >= _selectIndex)
            {
                beforeValue = _entityListD[_selectIndex]._payment_cash_division_id;
            }

            masterDlg = new Dlg_MstSearch();
            masterDlg.MstKbn = MstData.geMDataKbn.RecieptDivision;
            masterDlg.Show();
            masterDlg.Closed += masterDlg_Closed;
        }
        private void btnInventory_Click(object sender, RoutedEventArgs e)
        {
            if (ExCast.zCStr(utlID.txtID.Text.Trim()) != "")
            {
            }
            else
            {
                ExMessageBox.Show("商品を選択して下さい。");
                return;
            }

            Dlg_MstSearch searchDlg = new Dlg_MstSearch(MstData.geMDataKbn.Inventory);
            searchDlg.MstKbn = Class.Data.MstData.geMDataKbn.Inventory;
            searchDlg.MstGroupKbn = Class.Data.MstData.geMGroupKbn.None;
            searchDlg.txtCode.Text = ExCast.zNumZeroNothingFormat(ExCast.zCStr(utlID.txtID.Text.Trim()));
            searchDlg.Show();
        }
        private void btnSalesBalance_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.utlInvoice.txtID.Text.Trim()))
            {
                ExMessageBox.Show("請求先を選択して下さい。");
                return;
            }

            if (!string.IsNullOrEmpty(this.utlInvoice.txtID.Text.Trim()) && string.IsNullOrEmpty(this.utlInvoice.txtNm.Text.Trim()))
            {
                ExMessageBox.Show("請求先が適切に選択(入力)されていません。");
                return;
            }

            Dlg_MstSearch searchDlg = new Dlg_MstSearch(MstData.geMDataKbn.SalesBalance);
            searchDlg.MstKbn = Class.Data.MstData.geMDataKbn.SalesBalance;
            searchDlg.MstGroupKbn = Class.Data.MstData.geMGroupKbn.None;
            searchDlg.txtCode.Text = this.utlInvoice.txtID.Text.Trim();
            searchDlg.Show();
        }
        private void txtID_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (this.txtID_IsReadOnly == true) return;
            if (this.IsSearchDlgOpen == true) return;

            switch (this.MstKbn)
            {
                case MstData.geMDataKbn.Customer:
                case MstData.geMDataKbn.Customer_F:
                case MstData.geMDataKbn.Customer_T:
                case MstData.geMDataKbn.Invoice:
                case MstData.geMDataKbn.Invoice_F:
                case MstData.geMDataKbn.Invoice_T:
                case MstData.geMDataKbn.Commodity:
                case MstData.geMDataKbn.Commodity_F:
                case MstData.geMDataKbn.Commodity_T:
                case MstData.geMDataKbn.Purchase:
                case MstData.geMDataKbn.Purchase_F:
                case MstData.geMDataKbn.Purchase_T:
                    searchGroupDlg = new Dlg_MstSearchGroup();
                    searchGroupDlg.MstKbn = this.MstKbn;
                    searchGroupDlg.MstGroupKbn = this.MstGroupKbn;

                    Dlg_MstSearchGroup.this_id2 = this.txtID2.Text.Trim();

                    searchGroupDlg.Show();
                    this.IsSearchDlgOpen = true;
                    searchGroupDlg.Closed -= searchGroupDlg_Closed;
                    searchGroupDlg.Closed += searchGroupDlg_Closed;
                    break;
                default:
                    searchDlg = new Dlg_MstSearch();
                    searchDlg.MstKbn = this.MstKbn;
                    searchDlg.MstGroupKbn = this.MstGroupKbn;

                    Dlg_MstSearch.this_id2 = this.txtID2.Text.Trim();

                    searchDlg.Show();
                    this.IsSearchDlgOpen = true;
                    searchDlg.Closed -= searchDlg_Closed;
                    searchDlg.Closed += searchDlg_Closed;
                    break;
            }

        }
        private void txtZipNo2_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (this.IsSearchDlgOpen == true) return;

            searchDlg = new Dlg_MstSearch(MstData.geMDataKbn.Zip);
            searchDlg.MstKbn = MstData.geMDataKbn.Zip;
            searchDlg.Show();
            this.IsSearchDlgOpen = true;
            searchDlg.Closed += searchDlg_Closed;
        }