// 受注リスト取得コールバック呼出
        public override void DataSelect(int intKbn, object objList)
        {
            if ((ExWebService.geWebServiceCallKbn)intKbn == this.WebServiceCallKbn)
            {
                if (objList != null)
                {
                    entityList = (ObservableCollection <EntityOrder>)objList;
                    var records =
                        (from n in entityList
                         orderby n.order_ymd descending, n.no descending
                         select new { n.no, n.order_ymd, n.estimateno, n.customer_nm, n.supplier_nm, n.supply_ymd, n.business_division_nm, n.deliver_division_nm }).Distinct();

                    this.lst.Clear();
                    foreach (var rec in records)
                    {
                        string _no          = ExCast.zFormatForID(rec.no, Common.gintidFigureSlipNo);
                        string _estimate_no = ExCast.zFormatForID(rec.estimateno, Common.gintidFigureSlipNo);
                        if (ExCast.zCLng(_estimate_no) == 0)
                        {
                            _estimate_no = "";
                        }

                        lst.Add(new DisplayOrderList(rec.no,
                                                     _no,
                                                     rec.order_ymd,
                                                     rec.estimateno,
                                                     _estimate_no,
                                                     rec.customer_nm,
                                                     rec.supplier_nm,
                                                     rec.supply_ymd,
                                                     rec.business_division_nm,
                                                     rec.deliver_division_nm));
                    }

                    this.dg.Focus();
                    this.dg.ItemsSource       = null;
                    this.dg.ItemsSource       = lst;
                    this.dgSelect.ItemsSource = null;
                    this.dgSelect.ItemsSource = lst;
                    if (lst.Count > 0)
                    {
                        this.dg.SelectedIndex = 0;
                    }
                    ExBackgroundWorker.DoWork_Focus(dg, 10);
                }
                else
                {
                    entityList = null;
                    this.lst.Clear();
                    this.dg.ItemsSource       = null;
                    this.dgSelect.ItemsSource = null;
                    ExBackgroundWorker.DoWork_Focus(this.datOrderYmd_F, 10);
                }
            }
        }
Ejemplo n.º 2
0
        // リスト取得コールバック呼出
        public override void DataSelect(int intKbn, object objList)
        {
            if ((ExWebService.geWebServiceCallKbn)intKbn == this.WebServiceCallKbn)
            {
                if (objList != null)
                {
                    entityList = (ObservableCollection <EntityPaymentCash>)objList;
                    var records =
                        (from n in entityList
                         orderby n.payment_cash_ymd descending, n.no descending
                         select new { n.no, n.payment_cash_ymd, n.purchase_id, n.purchase_nm, n.sum_price }).Distinct();

                    this.lst.Clear();
                    foreach (var rec in records)
                    {
                        string _no = ExCast.zFormatForID(rec.no, Common.gintidFigureSlipNo);

                        lst.Add(new DisplayPaymentCashList(rec.no,
                                                           _no,
                                                           rec.payment_cash_ymd,
                                                           rec.purchase_id,
                                                           rec.purchase_nm,
                                                           rec.sum_price.ToString("#,##0")));
                    }

                    this.dg.Focus();
                    this.dg.ItemsSource = null;
                    this.dg.ItemsSource = lst;
                    if (lst.Count > 0)
                    {
                        this.dg.SelectedIndex = 0;
                    }
                    ExBackgroundWorker.DoWork_Focus(dg, 10);
                }
                else
                {
                    entityList = null;
                    this.lst.Clear();
                    this.dg.ItemsSource = null;
                    ExBackgroundWorker.DoWork_Focus(this.datPaymentCashYmd_F, 10);
                }
            }
        }
        // リスト取得コールバック呼出
        public override void DataSelect(int intKbn, object objList)
        {
            if ((ExWebService.geWebServiceCallKbn)intKbn == this.WebServiceCallKbn)
            {
                if (objList != null)
                {
                    entityList = (ObservableCollection <EntityPaymentClose>)objList;
                    var records =
                        (from n in entityList
                         orderby n._payment_close_yyyymmdd descending, n._no descending
                         select new { n._payment_cash_receivable_kbn_nm,
                                      n._payment_print_flg_nm,
                                      n._payment_kbn_nm,
                                      n._no,
                                      n._payment_close_yyyymmdd,
                                      n._purchase_id,
                                      n._purchase_nm,
                                      n._before_payment_price,
                                      n._payment_cash_price,
                                      n._transfer_price,
                                      n._no_tax_purchase_price,
                                      n._tax,
                                      n._payment_price,
                                      n._this_payment_cash_price,
                                      n._payment_zan_price }).Distinct();

                    this.lst.Clear();
                    foreach (var rec in records)
                    {
                        string _no         = ExCast.zFormatForID(rec._no, Common.gintidFigureSlipNo);
                        string _invoice_id = ExCast.zFormatForID(rec._purchase_id, Common.gintidFigureCustomer);
                        if (ExCast.zCLng(_no) == 0)
                        {
                            _no = "";
                        }

                        DisplayPaymentList _entity = new DisplayPaymentList();

                        _entity.exec_flg = false;
                        _entity.payment_receivable_kbn_nm = rec._payment_cash_receivable_kbn_nm;
                        _entity.payment_print_flg_nm      = rec._payment_print_flg_nm;
                        //_entity.invoice_kbn_nm = rec._invoice_kbn_nm;
                        _entity.no = rec._no;
                        _entity.payment_yyyymmdd      = rec._payment_close_yyyymmdd;
                        _entity.purchase_id           = rec._purchase_id;
                        _entity.purchase_nm           = rec._purchase_nm;
                        _entity.before_payment_price  = rec._before_payment_price;
                        _entity.payment_cash_price    = rec._payment_cash_price;
                        _entity.transfer_price        = rec._transfer_price;
                        _entity.no_tax_purchase_price = rec._no_tax_purchase_price;
                        _entity.tax                     = rec._tax;
                        _entity.payment_price           = rec._payment_price;
                        _entity.this_payment_cash_price = rec._this_payment_cash_price;
                        _entity.payment_zan_price       = rec._payment_zan_price;

                        lst.Add(_entity);
                    }

                    this.dgPrint.Focus();
                    this.dgPrint.ItemsSource  = null;
                    this.dgPrint.ItemsSource  = lst;
                    this.dgSelect.ItemsSource = null;
                    this.dgSelect.ItemsSource = lst;
                    if (lst.Count > 0)
                    {
                        this.dgPrint.SelectedIndex = 0;
                    }
                    ExBackgroundWorker.DoWork_Focus(this.dgSelect, 10);
                }
                else
                {
                    entityList = null;
                    this.lst.Clear();
                    this.dgPrint.ItemsSource  = null;
                    this.dgSelect.ItemsSource = null;
                    ExBackgroundWorker.DoWork_Focus(this.utlPaymentNo_F.txtID, 10);
                }
            }
        }
        private void searchDlg_Closed(object sender, EventArgs e)
        {
            try
            {
                long _no           = 0;
                bool _DialogResult = false;

                Common.gWinGroupType = _beforeWinGroupType;

                Dlg_InpSearch dlg = (Dlg_InpSearch)sender;
                ExUserControl utl = (ExUserControl)ExVisualTreeHelper.FindUserControl(dlg, "utlInpSearch");
                switch (Common.gWinType)
                {
                case Common.geWinType.ListOrder:                    // 受注一覧
                    Common.InpSearchOrder.Closed -= searchDlg_Closed;
                    Utl_InpSearchOrder utlInpOrder = (Utl_InpSearchOrder)utl;
                    _no           = utlInpOrder.no;
                    _DialogResult = utlInpOrder.DialogResult;
                    break;

                case Common.geWinType.ListEstimat:                  // 見積一覧
                    Common.InpSearchEstimate.Closed -= searchDlg_Closed;
                    Utl_InpSearchEstimate utlInpEstimate = (Utl_InpSearchEstimate)utl;
                    _no           = utlInpEstimate.no;
                    _DialogResult = utlInpEstimate.DialogResult;
                    break;

                case Common.geWinType.ListSales:                    // 売上一覧
                    Common.InpSearchSales.Closed -= searchDlg_Closed;
                    Utl_InpSearchSales utlInpSales = (Utl_InpSearchSales)utl;
                    _no           = utlInpSales.no;
                    _DialogResult = utlInpSales.DialogResult;
                    break;

                case Common.geWinType.ListReceipt:                  // 入金一覧
                    Common.InpSearchReceipt.Closed -= searchDlg_Closed;
                    Utl_InpSearchReceipt utlInpReceipt = (Utl_InpSearchReceipt)utl;
                    _no           = utlInpReceipt.no;
                    _DialogResult = utlInpReceipt.DialogResult;
                    break;

                case Common.geWinType.ListInvoice:                  // 請求一覧
                    Common.InpSearchInvoice.Closed -= searchDlg_Closed;
                    Utl_InpInvoicePrint utlInpInvoice = (Utl_InpInvoicePrint)utl;
                    _no           = utlInpInvoice.no;
                    _DialogResult = utlInpInvoice.DialogResult;
                    break;

                case Common.geWinType.ListPurchaseOrder:            // 発注一覧
                    Common.InpSearchPurchaseOrder.Closed -= searchDlg_Closed;
                    Utl_InpSearchPurchaseOrder utlInpSearchPurchaseOrder = (Utl_InpSearchPurchaseOrder)utl;
                    _no           = utlInpSearchPurchaseOrder.no;
                    _DialogResult = utlInpSearchPurchaseOrder.DialogResult;
                    break;

                case Common.geWinType.ListPurchase:                 // 仕入一覧
                    Common.InpSearchPurchase.Closed -= searchDlg_Closed;
                    Utl_InpSearchPurchase utlInpSearchPurchase = (Utl_InpSearchPurchase)utl;
                    _no           = utlInpSearchPurchase.no;
                    _DialogResult = utlInpSearchPurchase.DialogResult;
                    break;

                case Common.geWinType.ListPaymentCash:              // 出金一覧
                    Common.InpSearchPaymentCash.Closed -= searchDlg_Closed;
                    Utl_InpSearchPaymentCash utlInpSearchPaymentCash = (Utl_InpSearchPaymentCash)utl;
                    _no           = utlInpSearchPaymentCash.no;
                    _DialogResult = utlInpSearchPaymentCash.DialogResult;
                    break;

                case Common.geWinType.ListPayment:                  // 支払一覧
                    Common.InpSearchPayment.Closed -= searchDlg_Closed;
                    Utl_InpPaymentPrint utlInpSearchPayment = (Utl_InpPaymentPrint)utl;
                    _no           = utlInpSearchPayment.no;
                    _DialogResult = utlInpSearchPayment.DialogResult;
                    break;

                case Common.geWinType.ListInOutDelivery:            // 入出庫一覧
                    Common.InpSearchInOutDelivery.Closed -= searchDlg_Closed;
                    Utl_InpSearchInOutDelivery utlInpSearchInOutDelivery = (Utl_InpSearchInOutDelivery)utl;
                    _no           = utlInpSearchInOutDelivery.no;
                    _DialogResult = utlInpSearchInOutDelivery.DialogResult;
                    break;

                default:
                    break;
                }

                if (_DialogResult == true)
                {
                    string _str = ExCast.zFormatForID(_no, Common.gintidFigureSlipNo);
                    this.txtID.Text = _str;
                    this.txtID.Text = _str;

                    // 次コントロールフォーカスセット
                    //ExVisualTreeHelper.FoucsNextControlNoFocus(this);
                    this.Focus();
                    this.txtID.UpdataFlg = true;
                    this.ExUserControl_LostFocus(null, null);
                }
                else
                {
                    this.txtID.Focus();
                }
            }
            finally
            {
                this.IsSearchDlgOpen = false;
            }
        }
        // 入出庫リスト取得コールバック呼出
        public override void DataSelect(int intKbn, object objList)
        {
            if ((ExWebService.geWebServiceCallKbn)intKbn == this.WebServiceCallKbn)
            {
                if (objList != null)
                {
                    entityList = (ObservableCollection <EntityInOutDelivery>)objList;
                    var records =
                        (from n in entityList
                         orderby n.in_out_delivery_ymd descending, n.no descending, n.in_out_delivery_kbn, n.in_out_delivery_proc_kbn
                         select new { n.no,
                                      n.cause_no,
                                      n.in_out_delivery_ymd,
                                      n.in_out_delivery_kbn_nm,
                                      n.in_out_delivery_proc_kbn_nm,
                                      n.in_out_delivery_to_kbn_nm,
                                      n.in_out_delivery_to_nm,
                                      n.group_id_to_nm,
                                      n.customer_nm,
                                      n.purchase_name,
                                      n.sum_number }).Distinct();

                    this.lst.Clear();
                    foreach (var rec in records)
                    {
                        string _no       = ExCast.zFormatForID(rec.no, Common.gintidFigureSlipNo);
                        string _cause_no = ExCast.zFormatForID(rec.cause_no, Common.gintidFigureSlipNo);
                        if (ExCast.zCLng(_cause_no) == 0)
                        {
                            _cause_no = "";
                        }

                        DisplayList _displayList = new DisplayList();
                        _displayList.no                          = rec.no;
                        _displayList.str_no                      = _no;
                        _displayList.str_cause_no                = _cause_no;
                        _displayList.in_out_delivery_ymd         = rec.in_out_delivery_ymd;
                        _displayList.in_out_delivery_kbn_nm      = rec.in_out_delivery_kbn_nm;
                        _displayList.in_out_delivery_proc_kbn_nm = rec.in_out_delivery_proc_kbn_nm;
                        _displayList.in_out_delivery_to_kbn_nm   = rec.in_out_delivery_to_kbn_nm;
                        _displayList.in_out_delivery_to_nm       = rec.in_out_delivery_to_nm;
                        _displayList.group_nm                    = rec.group_id_to_nm;
                        _displayList.customer_nm                 = rec.customer_nm;
                        _displayList.purchase_nm                 = rec.purchase_name;
                        _displayList.sum_number                  = rec.sum_number;

                        lst.Add(_displayList);
                    }

                    this.dg.Focus();
                    this.dg.ItemsSource       = null;
                    this.dg.ItemsSource       = lst;
                    this.dgSelect.ItemsSource = null;
                    this.dgSelect.ItemsSource = lst;
                    if (lst.Count > 0)
                    {
                        this.dg.SelectedIndex = 0;
                    }
                    ExBackgroundWorker.DoWork_Focus(dg, 10);
                }
                else
                {
                    entityList = null;
                    this.lst.Clear();
                    this.dg.ItemsSource       = null;
                    this.dgSelect.ItemsSource = null;
                    ExBackgroundWorker.DoWork_Focus(this.datInOutDeliveryYmd_F, 10);
                }
            }
        }