Example #1
0
        /// <summary>
        /// 模型数据改变
        /// </summary>
        /// <param name="obj"></param>
        private void dataChanged(MatWareHouseLocationInfoModel MatWareHouseLocationInfoChange)
        {
            getPageData(pageRepuestParams.PageIndex, pageRepuestParams.PageSize);
            var tmpModel = MatWareHouseLocationInfoList.FirstOrDefault(a => a.Id == MatWareHouseLocationInfoChange.Id);

            this.MatWareHouseLocationInfo = MatWareHouseLocationInfoList.FirstOrDefault();
        }
Example #2
0
        /// <summary>
        /// 库位选择项改变命令函数
        /// </summary>
        private void OnExecuteWareHouseLocationSelectionChangedCommand()
        {
            MatWareHouseLocationInfoModel matwarehouselocationInfo = MatWareHouseLocationInfoList.FirstOrDefault(m => m.Id == MaterialOutStorageInfo.WareHouseLocationID);

            //
            if (matwarehouselocationInfo != null)
            {
                MaterialOutStorageInfo.PalletID = matwarehouselocationInfo.PalletID;
            }
            else
            {
                MaterialOutStorageInfo.PalletID = null;
            }
        }
Example #3
0
        /// <summary>
        /// 取得分页数据
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        private void getPageDataMatWareHouseLocation(int pageIndex, int pageSize, int iType)
        {
#if DEBUG
            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
            stopwatch.Start();
#endif
            //pageRepuestParams.SortField = "LastUpdatedTime";
            pageRepuestParams.SortOrder = "desc";

            pageRepuestParams.PageIndex = pageIndex;
            pageRepuestParams.PageSize  = pageSize;


            //_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
            //Console.WriteLine(await (await _httpClient.GetAsync("/api/service/EnterpriseInfo/Get?id='1'")).Content.ReadAsStringAsync());
            //
            string sType = "";
            //原料手动入库
            if (iType == 1)
            {
                sType = "MatWareHouseLocationInfo/PageDataPallet1";
            }
            //空托盘入库
            else if (iType == 2)
            {
                sType = "MatWareHouseLocationInfo/PageDataPallet2";
            }
            //
            //var result = Utility.Http.HttpClientHelper.PostResponse<OperationResult<PageResult<MatWareHouseLocationInfoModel>>>(GlobalData.ServerRootUri + "MatWareHouseLocationInfo/PageData", Utility.JsonHelper.ToJson(pageRepuestParams));
            var result = Utility.Http.HttpClientHelper.PostResponse <OperationResult <PageResult <MatWareHouseLocationInfoModel> > >(GlobalData.ServerRootUri + sType, Utility.JsonHelper.ToJson(pageRepuestParams));

#if DEBUG
            stopwatch.Stop();
            Utility.LogHelper.Info("获取库位信息用时(毫秒):" + stopwatch.ElapsedMilliseconds);
            Utility.LogHelper.Info("库位信息内容:" + Utility.JsonHelper.ToJson(result));
#endif

            if (!Equals(result, null) && result.Successed)
            {
                Application.Current.Resources["UiMessage"] = result?.Message;
                LogHelper.Info(Application.Current.Resources["UiMessage"].ToString());
                if (result.Data.Data.Any())
                {
                    //RoleInfoList = new ObservableCollection<RoleModel>(result.Data.Data);
                    MatWareHouseLocationInfoList = new ObservableCollection <MatWareHouseLocationInfoModel>();
                    foreach (var data in result.Data.Data)
                    {
                        MatWareHouseLocationInfoModel matwarehouselocationinfo = new MatWareHouseLocationInfoModel();
                        matwarehouselocationinfo = data;
                        //
                        //原料手动入库
                        if (iType == 1)
                        {
                            //原料库位
                            if ((matwarehouselocationinfo.StorageQuantity == null || matwarehouselocationinfo.StorageQuantity <= 0) &&
                                matwarehouselocationinfo.WareHouseLocationType == WareHouseLocationTypeEnumModel.WareHouseLocationType.MaterialWareHouseLocationType)
                            {
                                matwarehouselocationinfo.PropertyChanged += OnPropertyChangedCommand;
                                MatWareHouseLocationInfoList.Add(matwarehouselocationinfo);
                            }
                        }
                        //空托盘入库
                        else if (iType == 2)
                        {
                            //原料库位
                            if (matwarehouselocationinfo.IsUse &&
                                matwarehouselocationinfo.WareHouseLocationType == WareHouseLocationTypeEnumModel.WareHouseLocationType.MaterialWareHouseLocationType)
                            {
                                matwarehouselocationinfo.PropertyChanged += OnPropertyChangedCommand;
                                MatWareHouseLocationInfoList.Add(matwarehouselocationinfo);
                            }
                        }
                        //
                    }
                    int TotalCounts = result.Data.Total;
                }
                else
                {
                    MatWareHouseLocationInfoList?.Clear();
                    Application.Current.Resources["UiMessage"] = "未找到数据";
                }
            }
            else
            {
                //操作失败,显示错误信息
                MatWareHouseLocationInfoList = new ObservableCollection <MatWareHouseLocationInfoModel>();
                Application.Current.Resources["UiMessage"] = result?.Message ?? "查询库位信息失败,请联系管理员!";
            }
        }