/// <summary> /// 模型数据改变 /// </summary> /// <param name="obj"></param> private void dataChanged(MatWareHouseAreaInfoModel MatWareHouseAreaInfoChange) { getPageData(pageRepuestParams.PageIndex, pageRepuestParams.PageSize); var tmpModel = MatWareHouseAreaInfoList.FirstOrDefault(a => a.Id == MatWareHouseAreaInfoChange.Id); this.MatWareHouseAreaInfo = MatWareHouseAreaInfoList.FirstOrDefault(); }
public static void SetLocationQuantity(MatWareHouseAreaInfoModel matwarehouseareaInfo) { if (matwarehouseareaInfo.ColumnNumber != null && matwarehouseareaInfo.LayerNumber != null) { int dLocationQuantity = matwarehouseareaInfo.ColumnNumber.Value * matwarehouseareaInfo.LayerNumber.Value; // matwarehouseareaInfo.LocationQuantity = dLocationQuantity; } }
/// //////////////////////////////////////////////////////////////////////// #region 分页数据查询 /// <summary> /// 取得分页数据 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// /// <summary> /// 获取仓库列表 /// </summary> private void getPageDataMatWareHouseArea(Guid matwarehouseSelection) { #if DEBUG System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); #endif pageRepuestParams.SortField = "LastUpdatedTime"; pageRepuestParams.SortOrder = "desc"; pageRepuestParams.PageIndex = 1; pageRepuestParams.PageSize = int.Parse(Utility.ConfigHelper.GetAppSetting("PageSize")); //_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); //Console.WriteLine(await (await _httpClient.GetAsync("/api/service/WareHouseInfo/Get?id='1'")).Content.ReadAsStringAsync()); // MatWareHouseAreaInfoModel matwarehouseareainfoModel = new MatWareHouseAreaInfoModel(); matwarehouseareainfoModel.Id = matwarehouseSelection; // var result = Utility.Http.HttpClientHelper.PostResponse <OperationResult <PageResult <MatWareHouseAreaInfoModel> > >(GlobalData.ServerRootUri + "MatWareHouseAreaInfo/GetWareHouseAreaListByID", Utility.JsonHelper.ToJson(matwarehouseareainfoModel)); #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()) { //TotalCounts = result.Data.Total; //Messenger.Default.Send(LoginUser, MessengerToken.LoginSuccess); MatWareHouseAreaInfoList = new ObservableCollection <MatWareHouseAreaInfoModel>(result.Data.Data); TotalCounts = result.Data.Total; } else { MatWareHouseAreaInfoList?.Clear(); TotalCounts = 0; Application.Current.Resources["UiMessage"] = "未找到数据"; } } else { //操作失败,显示错误信息 MatWareHouseAreaInfoList = new ObservableCollection <MatWareHouseAreaInfoModel>(); Application.Current.Resources["UiMessage"] = result?.Message ?? "查询仓库货区信息失败,请联系管理员!"; } }