Example #1
0
 /// <summary>
 /// 模型数据改变
 /// </summary>
 /// <param name="obj"></param>
 private void dataChanged(PlanProductionProcessRequirementInfoModel productInfoModel)
 {
     getPageData();
     getPageData1();
     getPageData2();
     this.PlanProductionProcessRequirementInfo = PlanProductionProcessRequirementInfoList.FirstOrDefault();
 }
Example #2
0
        /// <summary>
        /// 取得工序需求数据
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        private void getPageData()
        {
#if DEBUG
            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
            stopwatch.Start();
#endif


            var result = Utility.Http.HttpClientHelper.PostResponse <OperationResult <PageResult <PlanProductionProcessRequirementInfoModel> > >(GlobalData.ServerRootUri + "PlanOrderItemInfo/GetProcessRequireInfoListByScheduleID", Utility.JsonHelper.ToJson(PlanProductionScheduleInfo));

#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);
                    PlanProductionProcessRequirementInfoList = new ObservableCollection <PlanProductionProcessRequirementInfoModel>(result.Data.Data);
                    TotalCounts = result.Data.Total;
                }
                else
                {
                    PlanProductionProcessRequirementInfoList?.Clear();
                    TotalCounts = 0;
                    Application.Current.Resources["UiMessage"] = "未找到数据";
                }
            }
            else
            {
                //操作失败,显示错误信息
                PlanProductionProcessRequirementInfoList   = new ObservableCollection <PlanProductionProcessRequirementInfoModel>();
                Application.Current.Resources["UiMessage"] = result?.Message ?? "查询工序需求信息失败,请联系管理员!";
            }
        }