示例#1
0
 /// <summary>
 /// Get BO of a process.
 /// </summary>
 /// <param name="pid">process pid</param>
 /// <returns>A List of Dictonary of BO items</returns>
 public static List <Dictionary <String, String> > GetProcessBO(string pid)
 {
     try
     {
         NetClient.PostData(GlobalContext.URL_GetProcessBOByPid,
                            new Dictionary <string, string>
         {
             { "token", MPController.CurrentTransaction.AuthToken },
             { "pid", pid }
         },
                            out var retStr);
         var response = JsonConvert.DeserializeObject <StdResponseEntity>(retStr);
         var boList   = ReturnDataHelper.DecodeList(response);
         return(boList.Select(bo => (bo as JArray).ToObject <List <String> >())
                .Select(boKVP => new Dictionary <string, string>
         {
             { "boid", boKVP[0] },
             { "bo_name", boKVP[1] }
         })
                .ToList());
     }
     catch (Exception ex)
     {
         LogUtils.LogLine("GetProcessBO exception occurred" + ex, "MPController", LogLevel.Error);
         return(null);
     }
 }
示例#2
0
 /// <summary>
 /// Get processes of a ren user.
 /// </summary>
 /// <returns>A list of dictionary of processes</returns>
 public static List <Dictionary <String, String> > GetProcess()
 {
     try
     {
         NetClient.PostData(GlobalContext.URL_GetProcessByRenId,
                            new Dictionary <string, string>
         {
             { "token", MPController.CurrentTransaction.AuthToken },
             { "renid", MPController.CurrentTransaction.RenUsername }
         },
                            out var retStr);
         var response    = JsonConvert.DeserializeObject <StdResponseEntity>(retStr);
         var processList = ReturnDataHelper.DecodeList(response);
         return(processList.Select(proc => (Dictionary <String, String>)(proc as JObject).ToObject(typeof(Dictionary <String, String>))).ToList());
     }
     catch (Exception ex)
     {
         LogUtils.LogLine("GetProcess exception occurred" + ex, "MPController", LogLevel.Error);
         return(null);
     }
 }