Exemple #1
0
 public CMSGroup(int groupId, string name, string description, CMSGroupType groupType)
 {
     this.CMSGroupId   = groupId;
     this.Name         = name;
     this.Description  = description;
     this.CMSGroupType = groupType;
 }
Exemple #2
0
        public void Test_Gets()
        {
            List <CMSGroup> records = new List <CMSGroup>();
            CMSGroupManager manager = new CMSGroupManager(this.DataStore);

            CMSGroupType groupType = DebugUtility.GetRandomEnum <CMSGroupType>(this.Random);

            for (int i = 0; i < 10; i++)
            {
                records.Add(Create(this.DataStore, this.Random));
            }
            foreach (CMSGroup record in records)
            {
                record.CMSGroupType = groupType;
                manager.Update(record);
            }

            List <CMSGroup> dsRecords = manager.GetAllGroups(groupType);

            Assert.GreaterOrEqual(dsRecords.Count, records.Count);

            foreach (CMSGroup record in records)
            {
                Assert.AreEqual(1, dsRecords.Count(c => c.CMSGroupId == record.CMSGroupId));
            }

            Assert.AreEqual(0, dsRecords.Count(c => c.CMSGroupType != groupType));

            foreach (CMSGroup record in records)
            {
                Delete(this.DataStore, record);
            }
        }
Exemple #3
0
 internal List <CMSGroup> GetAllGroups(CMSGroupType groupType)
 {
     try
     {
         using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
             return(dataStoreContext.cms_Groups_Get(groupType).ToList());
     }
     catch (Exception ex)
     {
         _Log.Error("Error at cms_Groups_Get", ex);
         throw new DataStoreException(ex, true);
     }
 }
Exemple #4
0
 internal List <CMSContent> GetContents(int applicationId, CMSGroupType groupType)
 {
     try
     {
         using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
         {
             return(dataStoreContext.cms_Contents_Get(applicationId, groupType).ToList());
         }
     }
     catch (Exception ex)
     {
         _Log.Error("Error at cms_Contents_Get", ex);
         throw new DataStoreException(ex, true);
     }
 }
Exemple #5
0
 internal CMSGroup(int groupId, string name, CMSGroupType cmsGroupType)
 {
     this.CMSGroupId   = groupId;
     this.Name         = name;
     this.CMSGroupType = cmsGroupType;
 }