示例#1
0
        public static ArrayList GetCustomSettingValues(int moduleId)
        {
            ArrayList customSettings = new ArrayList();

            using (IDataReader reader = DBModuleSettings.GetModuleSettings(moduleId))
            {
                while (reader.Read())
                {
                    int sortOrder = 100;
                    if (reader["SortOrder"] != DBNull.Value)
                    {
                        sortOrder = Convert.ToInt32(reader["SortOrder"]);
                    }

                    CustomModuleSetting setting
                        = new CustomModuleSetting(
                              new Guid(reader["FeatureGuid"].ToString()),
                              -1,
                              reader["ResourceFile"].ToString(),
                              reader["SettingName"].ToString().Trim(),
                              reader["SettingValue"].ToString(),
                              reader["ControlType"].ToString(),
                              reader["RegexValidationExpression"].ToString(),
                              reader["ControlSrc"].ToString(),
                              reader["HelpKey"].ToString(),
                              sortOrder
                              );
                    customSettings.Add(setting);
                }
            }

            return(customSettings);
        }
示例#2
0
 public static bool UpdateModuleSetting(
     Guid moduleGuid,
     int moduleId,
     string settingName,
     string settingValue)
 {
     return(DBModuleSettings.UpdateModuleSetting(moduleGuid, moduleId, settingName, settingValue));
 }
示例#3
0
        public static Hashtable GetModuleSettings(int moduleId)
        {
            Hashtable settings = new Hashtable();

            using (IDataReader dr = DBModuleSettings.GetModuleSettings(moduleId))
            {
                while (dr.Read())
                {
                    settings[dr["SettingName"].ToString().Trim()] = dr["SettingValue"].ToString();
                }
            }

            return(settings);
        }
示例#4
0
 public static bool CreateModuleSetting(
     Guid moduleGuid,
     int moduleId,
     string settingName,
     string settingValue,
     string controlType,
     string regexValidationExpression,
     string controlSrc,
     string helpKey,
     int sortOrder)
 {
     return(DBModuleSettings.CreateModuleSetting(
                Guid.NewGuid(),
                moduleGuid,
                moduleId,
                settingName,
                settingValue,
                controlType,
                regexValidationExpression,
                controlSrc,
                helpKey,
                sortOrder));
 }
示例#5
0
        public static ArrayList GetDefaultSettings(int moduleDefId)
        {
            ArrayList defaultCustomSettings = new ArrayList();

            using (IDataReader reader = DBModuleSettings.GetDefaultModuleSettings(moduleDefId))
            {
                while (reader.Read())
                {
                    int sortOrder = 100;
                    if (reader["SortOrder"] != DBNull.Value)
                    {
                        sortOrder = Convert.ToInt32(reader["SortOrder"]);
                    }

                    CustomModuleSetting setting = new CustomModuleSetting(
                        new Guid(reader["FeatureGuid"].ToString()),
                        Convert.ToInt32(reader["ID"]),
                        reader["ResourceFile"].ToString(),
                        reader["SettingName"].ToString().Trim(),
                        reader["SettingValue"].ToString(),
                        reader["ControlType"].ToString(),
                        reader["RegexValidationExpression"].ToString(),
                        reader["ControlSrc"].ToString(),
                        reader["HelpKey"].ToString(),
                        sortOrder,
                        reader["Attributes"].ToString(),
                        reader["Options"].ToString()
                        );

                    setting.GroupName = reader["GroupName"].ToString();
                    defaultCustomSettings.Add(setting);
                }
            }

            return(defaultCustomSettings);
        }
示例#6
0
 public static bool DeleteModuleSettings(int moduleId)
 {
     return(DBModuleSettings.DeleteModuleSettings(moduleId));
 }
示例#7
0
 public static bool CreateDefaultModuleSettings(int moduleId)
 {
     return(DBModuleSettings.CreateDefaultModuleSettings(moduleId));
 }