/// <summary> /// 模型数据改变 /// </summary> /// <param name="obj"></param> private void dataChanged(PlanOrderItemInfoModel planorderiteminfo) { getPageData(pageRepuestParams.PageIndex, pageRepuestParams.PageSize); var tmpModel = PlanOrderItemInfoList.FirstOrDefault(a => a.Id == planorderiteminfo.Id); this.PlanOrderItemInfo = PlanOrderItemInfoList.FirstOrDefault(); }
/// <summary> /// 是否可以执行打印命令 /// </summary> /// <returns></returns> private bool OnCanExecutePrintCommand() { if (Equals(PlanOrderItemInfoList, null) || !PlanOrderItemInfoList.Any()) { return(false); } else { return(true); } }
/// <summary> /// 取得分页数据 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> private void getPageData(int pageIndex, int pageSize) { #if DEBUG System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); #endif pageRepuestParams.SortField = GlobalData.SortField; pageRepuestParams.SortOrder = GlobalData.SortOrder; pageRepuestParams.PageIndex = pageIndex; pageRepuestParams.PageSize = pageSize; FilterGroup filterGroup = new FilterGroup(FilterOperate.Or); FilterRule filterRuleName = new FilterRule("Order.Id", PlanOrderInfo.Id, "equal"); filterGroup.Rules.Add(filterRuleName); pageRepuestParams.FilterGroup = filterGroup; var result = Utility.Http.HttpClientHelper.PostResponse <OperationResult <PageResult <PlanOrderItemInfoModel> > >(GlobalData.ServerRootUri + "PlanOrderItemInfo/PageData", 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()) { PlanOrderItemInfoList = new ObservableCollection <PlanOrderItemInfoModel>(result.Data.Data); TotalCounts = result.Data.Total; } else { PlanOrderItemInfoList?.Clear(); TotalCounts = 0; Application.Current.Resources["UiMessage"] = "未找到数据"; } } else { //操作失败,显示错误信息 PlanOrderItemInfoList = new ObservableCollection <PlanOrderItemInfoModel>(); Application.Current.Resources["UiMessage"] = result?.Message ?? "查询订单明细信息失败,请联系管理员!"; } }
/// <summary> /// 取得分页数据 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> private void getPageData(int pageIndex, int pageSize) { #if DEBUG System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); #endif pageRepuestParams.SortField = GlobalData.SortField; pageRepuestParams.SortOrder = GlobalData.SortOrder; pageRepuestParams.PageIndex = pageIndex; pageRepuestParams.PageSize = pageSize; var result = Utility.Http.HttpClientHelper.PostResponse <OperationResult <PageResult <PlanOrderItemInfoModel> > >(GlobalData.ServerRootUri + "PlanOrderItemInfo/PageData", 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()) { //TotalCounts = result.Data.Total; //Messenger.Default.Send(LoginUser, MessengerToken.LoginSuccess); PlanOrderItemInfoList = new ObservableCollection <PlanOrderItemInfoModel>(result.Data.Data); TotalCounts = result.Data.Total; } else { PlanOrderItemInfoList?.Clear(); TotalCounts = 0; Application.Current.Resources["UiMessage"] = "未找到数据"; } } else { //操作失败,显示错误信息 PlanOrderItemInfoList = new ObservableCollection <PlanOrderItemInfoModel>(); Application.Current.Resources["UiMessage"] = result?.Message ?? "查询子订单信息失败,请联系管理员!"; } }