コード例 #1
0
 public static async Task<LG.Services.EMS.PersonInfo> LoadPersonInfo(Int64 id)
 {
     var client = ClientConnection.GetEmsConnection();
     var result = new LG.Services.EMS.PersonInfo();
     try
     {
         client.Open();
         var response = await client.LoadPersonInfoAsync(
             new LoadPersonInfoRequest()
             {
                 MessageGuid = Guid.NewGuid(),
                 RID = id
             });
         result = response.PersonInfo;
     }
     catch (Exception ex)
     {
         client.Abort();
     }
     finally
     {
         if (client.State != CommunicationState.Closed)
         {
             client.Close();
         }
     }
     return result;
 }
コード例 #2
0
        public static async Task <LG.Services.EMS.PersonInfo> LoadPersonInfo(Int64 id)
        {
            var client = ClientConnection.GetEmsConnection();
            var result = new LG.Services.EMS.PersonInfo();

            try
            {
                client.Open();
                var response = await client.LoadPersonInfoAsync(
                    new LoadPersonInfoRequest()
                {
                    MessageGuid = Guid.NewGuid(),
                    RID         = id
                });

                result = response.PersonInfo;
            }
            catch (Exception ex)
            {
                client.Abort();
            }
            finally
            {
                if (client.State != CommunicationState.Closed)
                {
                    client.Close();
                }
            }
            return(result);
        }