Esempio n. 1
0
        /// <summary>
        /// Gets the store group.
        /// </summary>
        /// <param name="sid">The object owner.</param>
        /// <returns></returns>
        public IAzManStoreGroup GetStoreGroup(IAzManSid sid)
        {
            StoreGroupsResult sgr;

            if ((sgr = (from t in this.db.StoreGroups() where t.ObjectSid == sid.BinaryValue && t.StoreId == this.storeId select t).FirstOrDefault()) != null)
            {
                IAzManStoreGroup result = this.GetStoreGroup(sgr.Name);
                if (this.ens != null)
                {
                    this.ens.AddPublisher(result);
                }
                return(result);
            }
            else
            {
                throw SqlAzManException.StoreGroupNotFoundException(sid.StringValue, this, null);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the store group.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public IAzManStoreGroup GetStoreGroup(string name)
        {
            StoreGroupsResult sgr;

            if ((sgr = (from tf in this.db.StoreGroups() where tf.Name == name && tf.StoreId == this.storeId select tf).FirstOrDefault()) != null)
            {
                int              storeGroupid = sgr.StoreGroupId.Value;
                IAzManSid        objectSid    = new SqlAzManSID(sgr.ObjectSid.ToArray());
                string           description  = sgr.Description;
                string           lDapQuery    = sgr.LDapQuery;
                GroupType        groupType    = (GroupType)sgr.GroupType.Value;
                IAzManStoreGroup result       = new SqlAzManStoreGroup(this.db, this, storeGroupid, objectSid, name, description, lDapQuery, groupType, this.ens);
                if (this.ens != null)
                {
                    this.ens.AddPublisher(result);
                }
                return(result);
            }
            else
            {
                throw SqlAzManException.StoreGroupNotFoundException(name, this, null);
            }
        }