Exemplo n.º 1
0
        /// <summary>
        /// TODO:  Need to implement this method once the xml is stored in the database and is ready to be used from
        /// that centrally stored location - currently the xml is in xml files
        /// </summary>
        /// <returns></returns>
        public override RuleFields GetData(Guid applicationID, Guid typeID,
                                           DotNetNancy.Rules.RuleSet.DataAccess.Enumerations.ConfigurationTypes configurationType)
        {
            RuleFields ruleField = null;

            SqlParameter[] parameters = new SqlParameter[3] {
                SqlHelper.PrepareParameter(DataAccessConstants.ApplicationTable.APPLICATION_ID, applicationID),
                SqlHelper.PrepareParameter(DataAccessConstants.ConfigurationFileTable.TYPE_ID,
                                           typeID), SqlHelper.PrepareParameter(DataAccessConstants.ConfigurationFileTable.CONFIGURATION_TYPE_ID,
                                                                               (int)configurationType)
            };

            SqlDataReader reader = SqlHelper.ExecuteReader(SqlHelper.Connections[0],
                                                           CommandType.StoredProcedure, DataAccessConstants.GET_CONFIGURATION_FILE, parameters);

            DotNetNancy.Rules.RuleSet.DataAccess.DTO.List.ConfigurationFile files =
                new DotNetNancy.Rules.RuleSet.DataAccess.DTO.List.ConfigurationFile(reader);

            //there should only be one for this type and configuration type
            if (files.Count == 0)
            {
                throw new ApplicationException(string.Format("No configuration file found for application id {0}", applicationID.ToString()));
            }

            ruleField = new RuleFields(files[0].ConfigurationFile_Property);
            return(ruleField);
        }
Exemplo n.º 2
0
 public void setField(RuleFields field, Boolean value)
 {
     ruleFields[(int)field] = value;
 }
Exemplo n.º 3
0
 public void deactivateField(RuleFields field)
 {
     ruleFields[(int)field] = false;
 }
Exemplo n.º 4
0
 public void activateField(RuleFields field)
 {
     ruleFields[(int)field] = true;
 }