示例#1
0
        private IEnumerable <VertexData> GetRelationShipsForAdress2(string adress)
        {
            OdisAddressServiceClient proxyAsync = null;
            IEnumerable <VertexData> relationShipIds;

            try
            {
                proxyAsync = odicConnector.AddressServiceAsync;
                var relationships = proxyAsync.GetRelationships(int.Parse(adress), RelationshipDirection.Outgoing, true);
                relationShipIds = relationships
                                  .Take(5)
                                  .Select(r =>
                                          new VertexData(r.CounterPartAddressId.ToString(),
                                                         r.CounterPartAddress.FullName,
                                                         r.CounterPartAddress.StandardPhone,
                                                         r.CounterPartAddress.AddressImage,
                                                         r.Type.Name,
                                                         r.ReverseType.Name));
                ;
                proxyAsync.Close();
            }
            catch (Exception)
            {
                proxyAsync?.Abort();
                throw;
            }

            return(relationShipIds.Distinct());
        }
示例#2
0
        private VertexData GetDataFromAdressId(string adressId)
        {
            OdisAddressServiceClient proxyAsync = null;

            try
            {
                proxyAsync = odicConnector.AddressServiceAsync;
                var adress = proxyAsync.GetAddress(int.Parse(adressId), false);

                return(new VertexData(adressId, adress.FullName, adress.StandardPhone, adress.AddressImage, "", ""));
            }
            catch (Exception)
            {
                proxyAsync?.Abort();
                throw;
            }
            finally
            {
                proxyAsync?.Close();
            }
        }