public void NewProperty(Property property)
 {
     using (PropertyAccessClient _propertyAccessClient = new PropertyAccessClient(EndpointName.PropertyAccess))
     {
         _propertyAccessClient.Insert1(property);
     }
 }
 public PropertyCollection GetProperty(string propertyName)
 {
     using (PropertyAccessClient _propertyAccessClient = new PropertyAccessClient(EndpointName.PropertyAccess))
     {
         return new PropertyCollection(_propertyAccessClient.Query2(propertyName));
     }
 }
 public PropertyCollection GetAllProperties()
 {
     using (PropertyAccessClient _propertyAccessClient = new PropertyAccessClient(EndpointName.PropertyAccess))
     {
         return new PropertyCollection(_propertyAccessClient.QueryAll());
     }
 }
        public PropertyCollection GetPropertyValue(string propertyName)
        {
            if (propertyName.Equals(SpecialProperty.ClosedPeriod))
            {
                if (ClosedPeriodCache.Count == 0)
                {
                    using (PropertyAccessClient _propertyAccessClient = new PropertyAccessClient(EndpointName.PropertyAccess))
                    {
                        ClosedPeriodCache = new PropertyCollection(_propertyAccessClient.Query2(propertyName));
                    }
                }

                return ClosedPeriodCache;
            }

            using (PropertyAccessClient _propertyAccessClient = new PropertyAccessClient(EndpointName.PropertyAccess))
            {
                return new PropertyCollection(_propertyAccessClient.Query2(propertyName));
            }
        }
 public void NewProperty(PropertyCollection propertyCollection)
 {
     using (PropertyAccessClient _propertyAccessClient = new PropertyAccessClient(EndpointName.PropertyAccess))
     {
         _propertyAccessClient.Insert2(propertyCollection.ToArray());
     }
 }
        public void SetPropertyValue(string propertyName, string propertyValue)
        {
            PropertyCollection _propertyCollection = GetPropertyValue(propertyName);

            foreach (Property _property in _propertyCollection)
            {
                _property.PropertyValue = propertyValue;
            }

            using (PropertyAccessClient _propertyAccessClient = new PropertyAccessClient(EndpointName.PropertyAccess))
            {
                _propertyAccessClient.Update2(_propertyCollection.ToArray());
            }
        }
        /// <summary>
        /// Please use this function to update the property instead of PropertyAccessClient.Update1.
        /// This is very important, or the system may has error.
        /// </summary>
        /// <param name="propertyKey"></param>
        /// <param name="perty"></param>
        public void SetProperty(string propertyKey ,Property perty)
        {
            using (PropertyAccessClient _propertyAccessClient = new PropertyAccessClient(EndpointName.PropertyAccess))
            {
                _propertyAccessClient.Update1(propertyKey, perty);
            }

            if (propertyKey.Equals(SpecialProperty.ClosedPeriod))
            {
                ClosedPeriodCache = GetPropertyValue(propertyKey);
            }
        }