예제 #1
0
 /// <summary>
 /// 获取发动机详细信息
 /// </summary>
 /// <param name="code"></param>
 private EngineViewModel GetEngineCodeInfo(string code)
 {
     try
     {
         //获取发动机的机型
         return(RFIDDBHelper.GetEngineOther(code, ""));
     }
     catch (Exception ex)
     {
         Log.Error("处理发动机条码时出现异常", ex);
         return(null);
     }
 }
예제 #2
0
 private void SyncServerConfig()
 {
     try
     {
         bool ret = RFIDDBHelper.DownLoadServerConfig(_screenConfig.Station.StationID);
         ViewModel.PrintlnInfo($"同步{(ret ? "成功" : "失败")}!");
     }
     catch (Exception ex)
     {
         Log.Error(ex, "同步参数失败!");
         ViewModel.PrintlnWarning("同步失败");
     }
     Invoke(new Action(() =>
     {
         btSyncConfig.Enabled = true;
     }));
 }
예제 #3
0
        private EngineViewModel GetEngineViewModel(string code, string mto)
        {
            EngineViewModel model = null;

            try
            {
                if (!string.IsNullOrEmpty(code) && code != appConfig.NullCode)
                {
                    model = RFIDDBHelper.GetEngineOther(code, mto);
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "获取机型信息报错!");
                ViewModels[0].PrintlnWarning(ex.Message);
            }
            if (model == null)
            {
                model = EngineViewModel.CreateModel(code, mto);
            }
            return(model);
        }