示例#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);
        }
示例#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);
        }
示例#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;
 }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#10
0
 public int AddScopeType(ScopeType scopeType)
 {
     return Constants.SCOPETYPE_AddScopeTypeId;
 }
示例#11
0
 public void UpdateScopeType(ScopeType scopeType)
 {
 }
示例#12
0
 public void DeleteScopeType(ScopeType scopeType)
 {
 }