예제 #1
0
 //WF 20151010  只针对一种参数   使用
 public TargetByCode GetTarget(DataConnection pclsCache, string PlanNo, string Type, string Code)
 {
     TargetByCode targetByCode = new TargetByCode();
   
     try
     {
         if (!pclsCache.Connect())
         {
             return null;
         }
         InterSystems.Data.CacheTypes.CacheSysList CacheList = Ps.Target.GetTarget(pclsCache.CacheConnectionObject, PlanNo, Type, Code);
         if (CacheList != null)
         {
             targetByCode.Type = CacheList[1].ToString();
             targetByCode.Code = CacheList[2].ToString();
             targetByCode.Value = CacheList[3].ToString();
             targetByCode.Origin = CacheList[4].ToString();
             targetByCode.Instruction = CacheList[5].ToString();
             targetByCode.Unit = CacheList[6].ToString();
         }
         return targetByCode;
     }
     catch (Exception ex)
     {
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "PsTarget.GetTarget", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return null;
     }
     finally
     {
         pclsCache.DisConnect();
     }
 }
예제 #2
0
 public HttpResponseMessage PostTarget(TargetByCode item)
 {
     int ret = repository.SetTarget(pclsCache, item.Plan, item.Type, item.Code, item.Value, item.Origin, item.Instruction, item.Unit, item.piUserId, item.piTerminalName, new CommonFunction().getRemoteIPAddress(), item.piDeviceType);
     return new ExceptionHandler().SetData(Request, ret);
 }