public static List <string> GetAllEnterprises() { string result = client.getAllEnterprise(); ReturnCode code = GetReturn(result); VerifyReturnCode(code.code); DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(List <Enterprise>)); List <Enterprise> list = null; using (MemoryStream stream = new MemoryStream(Encoding.Unicode.GetBytes(result))) { list = serializer.ReadObject(stream) as List <Enterprise>; } List <string> resultList = new List <string>(); if (list == null) { return(resultList); } foreach (var item in list) { resultList.Add(item.entCname); } return(resultList); }
public static string GetAllEnterprise() { string result = client.getAllEnterprise(); return(result); }