Example #1
0
        public void DeleteScopeType(ScopeType scopeType)
        {
            //Argument Contract
            Requires.NotNull("scopeType", scopeType);
            Requires.PropertyNotNegative("scopeType", "ScopeTypeId", scopeType.ScopeTypeId);

            _DataService.DeleteScopeType(scopeType);

            //Refresh cached collection of types
            DataCache.RemoveCache(DataCache.ScopeTypesCacheKey);
        }
Example #2
0
        public int AddScopeType(ScopeType scopeType)
        {
            //Argument Contract
            Requires.NotNull("scopeType", scopeType);
            Requires.PropertyNotNullOrEmpty("scopeType", "ScopeType", scopeType.ScopeType);

            scopeType.ScopeTypeId = _DataService.AddScopeType(scopeType);

            //Refresh cached collection of types
            DataCache.RemoveCache(DataCache.ScopeTypesCacheKey);

            return(scopeType.ScopeTypeId);
        }
Example #3
0
        public int AddScopeType(ScopeType scopeType)
        {
            //Argument Contract
            Requires.NotNull("scopeType", scopeType);
            Requires.PropertyNotNullOrEmpty("scopeType", "ScopeType", scopeType.ScopeType);

            scopeType.ScopeTypeId = _DataService.AddScopeType(scopeType);

            //Refresh cached collection of types
            DataCache.RemoveCache(_CacheKey);

            return scopeType.ScopeTypeId;
        }
        public void DataService_AddScopeType_Adds_Record_On_Valid_ScopeType()
        {
            //Arrange
            int rowCount = DataUtil.GetRecordCount(DataTestHelper.ConnectionString,
                                                   ContentDataTestHelper.ScopeTypesTableName);
            DataUtil.AddDatabaseObject(virtualScriptFilePath, addScopeType);

            ScopeType scopeType = new ScopeType();
            scopeType.ScopeType = Constants.SCOPETYPE_ValidScopeType;

            DataService ds = new DataService();

            //Act
            int scopeTypeItemId = ds.AddScopeType(scopeType);

            //Assert
            DatabaseAssert.RecordCountIsEqual(DataTestHelper.ConnectionString, ContentDataTestHelper.ScopeTypesTableName,
                                              rowCount + 1);
        }
 internal static ScopeType CreateValidScopeType()
 {
     ScopeType scopeType = new ScopeType {ScopeType = Constants.SCOPETYPE_ValidScopeType};
     return scopeType;
 }
Example #6
0
		/// <summary>
		/// Updates the type of the scope.
		/// </summary>
		/// <param name="scopeType">Type of the scope.</param>
        public void UpdateScopeType(ScopeType scopeType)
        {
            _provider.ExecuteNonQuery("UpdateScopeType", scopeType.ScopeTypeId, scopeType.ScopeType);
        }
Example #7
0
		/// <summary>
		/// Deletes the type of the scope.
		/// </summary>
		/// <param name="scopeType">Type of the scope.</param>
        public void DeleteScopeType(ScopeType scopeType)
        {
            _provider.ExecuteNonQuery("DeleteScopeType", scopeType.ScopeTypeId);
        }
Example #8
0
		/// <summary>
		/// Adds the type of the scope.
		/// </summary>
		/// <param name="scopeType">Type of the scope.</param>
		/// <returns>scope type id.</returns>
        public int AddScopeType(ScopeType scopeType)
        {
            return _provider.ExecuteScalar<int>("AddScopeType", scopeType.ScopeType);
        }
Example #9
0
        public void DeleteScopeType(ScopeType scopeType)
        {
            //Argument Contract
            Requires.NotNull("scopeType", scopeType);
            Requires.PropertyNotNegative("scopeType", "ScopeTypeId", scopeType.ScopeTypeId);

            _DataService.DeleteScopeType(scopeType);

            //Refresh cached collection of types
            DataCache.RemoveCache(_CacheKey);
        }
Example #10
0
 public int AddScopeType(ScopeType scopeType)
 {
     return Constants.SCOPETYPE_AddScopeTypeId;
 }
Example #11
0
 public void UpdateScopeType(ScopeType scopeType)
 {
 }
Example #12
0
 public void DeleteScopeType(ScopeType scopeType)
 {
 }