Beispiel #1
0
        private void txtStockSysNo_KeyUp(object sender, KeyEventArgs e)
        {
            //只处理Enter事件
            if (e.Key != Key.Enter)
            {
                return;
            }
            this.StockID = "";
            string StockSysNoString = this.txtStockSysNo.Text.Trim();

            if (string.IsNullOrEmpty(StockSysNoString))
            {
                return;
            }
            //验证渠道库存系统编号
            int StockSysNo = 0;

            if (!int.TryParse(StockSysNoString, out StockSysNo))
            {
                CurrentWindow.Alert(string.Format(ResStockPicker.Tip_StockSysNoInvalid, StockSysNoString), MessageType.Warning);
                e.Handled = true;
                return;
            }
            var StockSelectedEvent = StockSelected;

            if (StockSelectedEvent != null)
            {
                var facade = new StockQueryFacade(CPApplication.Current.CurrentPage);
                facade.LoadStockBySysNo(StockSysNo, OnLoadStockBySysNo);
                e.Handled = true;
            }
        }
Beispiel #2
0
        /// <summary>
        /// 请求服务,并将查询结果绑定到DataGrid
        /// </summary>
        void DataGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e)
        {
            //1.初始化查询条件,分页信息
            //2.请求服务查询
            PagingInfo p = new PagingInfo
            {
                PageIndex = e.PageIndex,
                PageSize  = e.PageSize,
                SortBy    = e.SortField
            };
            StockQueryFacade facade = new StockQueryFacade(CPApplication.Current.CurrentPage);

            facade.QueryStock(_queryReq, p, (s, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                BindDataGrid(args.Result.TotalCount, args.Result.Rows);
            });
        }
Beispiel #3
0
        void txtStockID_KeyUp(object sender, KeyEventArgs e)
        {
            //只处理Enter事件
            if (e.Key != Key.Enter)
            {
                return;
            }
            this.StockSysNo = null;
            string StockID = this.txtStockID.Text.Trim();

            if (string.IsNullOrEmpty(StockID))
            {
                return;
            }
            var StockSelectedEvent = StockSelected;

            if (StockSelectedEvent != null)
            {
                var facade = new StockQueryFacade(CPApplication.Current.CurrentPage);
                facade.LoadStockByID(StockID, OnLoadStockByID);
                e.Handled = true;
            }
        }