Ejemplo n.º 1
0
        private IAddressGroup ReadAddressGroup(XmlNodeList addressCollectionIdNode, IAddressGroup entireAddressGroup, bool routingTableReadOnly)
        {
            bool addressCollectionsReadOnly = false;

            if (addressCollectionIdNode.Count > 0)
            {
                XmlNode node = addressCollectionIdNode[0].ParentNode;
                addressCollectionsReadOnly = PolicyUtilities.IsReadOnly(node);
            }

            IAddressGroup addressGroup = new AddressGroup(Guid.Empty, "", routingTableReadOnly || addressCollectionsReadOnly);

            List<string> exclusions = new List<string>();
            exclusions.Add("id");
            exclusions.Add("readonly");

            foreach (XmlNode addressIdNode in addressCollectionIdNode)
            {
                string addressId = addressIdNode.Attributes.GetNamedItem("id").InnerText;
                bool readOnly = PolicyUtilities.IsReadOnly(addressIdNode);
                AddressCollection currentCollection = entireAddressGroup[new Guid(addressId)] as AddressCollection;

                if (currentCollection != null)
                {
                    AddressCollection copiedCollection = new AddressCollection(currentCollection, readOnly);
                    new XmlCustomAttributesReader(copiedCollection, addressIdNode.Attributes, exclusions).Read();
                    addressGroup.Add(copiedCollection);
                }
            }

            return addressGroup;
        }
Ejemplo n.º 2
0
        private void AddAddresses(CustomGXNode usernode, IAddressGroup group)
        {
            foreach (IPolicyObject policyobject in group)
            {
                CustomGXNode groupnode = new CustomGXNode(policyobject.Name, policyobject);
                usernode.Nodes.Add(groupnode);

                //All the addresses
                /*if (policyobject is IAddressCollection)
                {
                    IAddressCollection collection = policyobject as IAddressCollection;
                    foreach (IAddress address in collection)
                    {
                        DevComponents.Tree.Node users = new DevComponents.Tree.Node();
                        users.Text = address.Value;
                        groupnode.Nodes.Add(users);
                    }
                }*/
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 根据联系人ID,获取客户对应的分组集合
        /// </summary>
        /// <param name="contactId">联系人ID</param>
        /// <returns></returns>
        public List <AddressGroupInfo> GetByContact(string contactId)
        {
            IAddressGroup dal = baseDal as IAddressGroup;

            return(dal.GetByContact(contactId));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 根据用户,获取树形结构的分组列表
        /// </summary>
        public List <AddressGroupNodeInfo> GetTree(string addressType, string creator = null)
        {
            IAddressGroup dal = baseDal as IAddressGroup;

            return(dal.GetTree(addressType, creator));
        }