Example #1
0
 public static List <Tuple <List <string>, Dictionary <String, String> > > GetWorkitem(string rtid)
 {
     try
     {
         var argDict = new Dictionary <string, string>
         {
             { "signature", Signature },
             { "rtid", rtid }
         };
         NetClient.PostData(URL_GetAllWorkitem, argDict, out var retStr);
         var response     = JsonConvert.DeserializeObject <StdResponseEntity>(retStr);
         var workitemList = ReturnDataHelper.DecodeList(response);
         var retList      = new List <Tuple <List <string>, Dictionary <String, String> > >();
         retList.AddRange(
             from workitem
             in workitemList
             select ReturnDataHelper.DecodeDictionaryByString(workitem.ToString())
             into wd
             let workerIdListDesc = wd["WorkerIdList"]
                                    let workerIdList = JsonConvert.DeserializeObject <List <String> >(workerIdListDesc)
                                                       select new Tuple <List <string>, Dictionary <String, String> >(workerIdList, wd));
         return(retList);
     }
     catch (Exception ex)
     {
         LogUtils.LogLine("Get workitems, exception occurred" + ex, LogLevel.Error);
         return(null);
     }
 }
Example #2
0
        /// <summary>
        /// Decode a standard response to a .NET dictionary(string, string) data struct.
        /// </summary>
        /// <param name="response">StdResponseEntity instance to be decoded</param>
        /// <returns>Dictionary in .NET</returns>
        public static Dictionary <String, String> DecodeToStringStringDictionary(StdResponseEntity response)
        {
            var returnElement = response.returnElement.data.ToString();
            var jtoken        = (JToken)JsonConvert.DeserializeObject <Object>(returnElement);

            return(ReturnDataHelper.DecodeDictionaryJToken(jtoken));
        }