Пример #1
0
        /// <summary>
        /// 模型数据改变
        /// </summary>
        /// <param name="obj"></param>
        private void dataChanged(ProductionProcessInfoModel productionLineModel)
        {
            getPageData(pageRepuestParams.PageIndex, pageRepuestParams.PageSize);
            var tmpModel = ProductionProcessInfoList.FirstOrDefault(a => a.Id == productionLineModel.Id);

            this.ProductionProcessInfo = ProductionProcessInfoList.FirstOrDefault();
        }
Пример #2
0
 private void OnExecuteareaSelectionChangedCommand()
 {
     EntProductionLineInfoList?.Clear();
     ProductionProcessInfoList?.Clear();
     this.EntProductionLineInfo.Id = Guid.Empty;
     ProductionRuleItemInfo.ProductionProcess_Id = Guid.Empty;
     getPageData3();
 }
Пример #3
0
 /// <summary>
 /// 是否可以执行打印命令
 /// </summary>
 /// <returns></returns>
 private bool OnCanExecutePrintCommand()
 {
     if (Equals(ProductionProcessInfoList, null) || !ProductionProcessInfoList.Any())
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Пример #4
0
 private void OnExecuteenterpriseSelectionChangedCommand()
 {
     EntSiteInfoList?.Clear();
     EntAreaInfoList?.Clear();
     EntProductionLineInfoList?.Clear();
     ProductionProcessInfoList?.Clear();
     this.EntProductionLineInfo.EntSite_Id       = Guid.Empty;
     this.EntProductionLineInfo.EntArea_Id       = Guid.Empty;
     this.EntProductionLineInfo.Id               = Guid.Empty;
     ProductionRuleItemInfo.ProductionProcess_Id = Guid.Empty;
     getPageData1();
 }
Пример #5
0
        /// <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;


            //_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
            //Console.WriteLine(await (await _httpClient.GetAsync("/api/service/EnterpriseInfo/Get?id='1'")).Content.ReadAsStringAsync());

            var result = Utility.Http.HttpClientHelper.PostResponse <OperationResult <PageResult <ProductionProcessInfoModel> > >(GlobalData.ServerRootUri + "ProductionProcessInfo/GetProductionProcessInfoList", 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);
                    ProductionProcessInfoList = new ObservableCollection <ProductionProcessInfoModel>(result.Data.Data);
                    TotalCounts = result.Data.Total;
                }
                else
                {
                    ProductionProcessInfoList?.Clear();
                    TotalCounts = 0;
                    Application.Current.Resources["UiMessage"] = "未找到数据";
                }
            }
            else
            {
                //操作失败,显示错误信息
                ProductionProcessInfoList = new ObservableCollection <ProductionProcessInfoModel>();
                Application.Current.Resources["UiMessage"] = result?.Message ?? "查询工序信息失败,请联系管理员!";
            }
        }
Пример #6
0
        private void InitLineData()
        {
#if DEBUG
            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
            stopwatch.Start();
#endif

            lineinfo.Id = ProductionProcessInfo.EntProductionLine_Id;

            var result = Utility.Http.HttpClientHelper.PostResponse <OperationResult <PageResult <EntProductionLineInfoModel> > >(GlobalData.ServerRootUri + "EntProductionLineInfo/GetEntProductionLineInfo1", Utility.JsonHelper.ToJson(lineinfo));

#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);
                    EntProductionLineInfoList = new ObservableCollection <EntProductionLineInfoModel>(result.Data.Data);
                    EntProductionLineInfo     = EntProductionLineInfoList.FirstOrDefault();
                }
                else
                {
                    ProductionProcessInfoList?.Clear();
                    //  TotalCounts = 0;
                    Application.Current.Resources["UiMessage"] = "未找到数据";
                }
            }
            else
            {
                //操作失败,显示错误信息
                EntProductionLineInfoList = new ObservableCollection <EntProductionLineInfoModel>();
                Application.Current.Resources["UiMessage"] = result?.Message ?? "查询生产线信息失败,请联系管理员!";
            }
        }
        /// <summary>
        /// 获取工序分页数据
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        private void getProcessPageData(int pageIndex, int pageSize)
        {
#if DEBUG
            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
            stopwatch.Start();
#endif
            pageRepuestParams           = new PageRepuestParams();
            pageRepuestParams.SortField = "ProductionProcessName";
            pageRepuestParams.SortOrder = "asc";
            pageRepuestParams.PageIndex = pageIndex;
            pageRepuestParams.PageSize  = pageSize;
            var result = Utility.Http.HttpClientHelper.PostResponse <OperationResult <PageResult <ProductionProcessInfoModel> > >(GlobalData.ServerRootUri + "ProductionProcessInfo/GetProductionProcessInfoList", 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())
                {
                    ProductionProcessInfoList = new ObservableCollection <ProductionProcessInfoModel>(result.Data.Data);
                    ProductionProcessInfoModel pro = new ProductionProcessInfoModel();
                    ProductionProcessInfoList.Insert(0, pro);
                }
                else
                {
                    ProductionProcessInfoList?.Clear();
                    Application.Current.Resources["UiMessage"] = "未找到数据";
                }
            }
            else
            {
                //操作失败,显示错误信息
                ProductionProcessInfoList = new ObservableCollection <ProductionProcessInfoModel>();
                Application.Current.Resources["UiMessage"] = result?.Message ?? "查询工序列表失败,请联系管理员!";
            }
        }
Пример #8
0
 private void OnExecutproductionLineSelectionChangedCommand()
 {
     ProductionProcessInfoList?.Clear();
     ProductionRuleItemInfo.ProductionProcess_Id = Guid.Empty;
     getPageData4();
 }