Esempio n. 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;
 }
Esempio n. 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);
        }