Пример #1
0
        public Config FindByParamName(string name)
        {
            string         dbparamname = string.Format("{0}_{1}", Prefix, name);
            CryptorManager cm          = CryptorManager.Instance;
            string         ConfigName  = cm.encrypt(dbparamname);

            return(FindByConfigName(ConfigName));
        }
Пример #2
0
 public string GetParamValue(string name)
 {
     if (ParamExists(name))
     {
         Config         _obj = FindByParamName(name);
         CryptorManager cm   = CryptorManager.Instance;
         return(cm.decrypt(_obj.ConfigValue));
     }
     else
     {
         return("");
     }
 }
Пример #3
0
        public bool ParamExists(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(false);
            }

            CryptorManager cm = CryptorManager.Instance;

            string dbparamname = string.Format("{0}_{1}", Prefix, name);
            string ConfigName  = cm.encrypt(dbparamname);

            return(Exists(ConfigName));
        }
Пример #4
0
        public void SetParam(string name, string value)
        {
            CryptorManager cm = CryptorManager.Instance;

            string dbparamname = string.Format("{0}_{1}", Prefix, name);
            string ConfigName  = cm.encrypt(dbparamname);
            string ConfigValue = cm.encrypt(value);

            Config _obj = null;

            if (ParamExists(name))
            {
                _obj             = FindByConfigName(ConfigName);
                _obj.ConfigValue = ConfigValue;
            }
            else
            {
                _obj             = CreateEntity();
                _obj.ConfigName  = ConfigName;
                _obj.ConfigValue = ConfigValue;
            }

            Store(_obj);
        }
Пример #5
0
        protected string Decrypt(string encrypted_value)
        {
            CryptorManager cm = CryptorManager.Instance;

            return(cm.decrypt(encrypted_value));
        }
Пример #6
0
        protected string Encrypt(string value)
        {
            CryptorManager cm = CryptorManager.Instance;

            return(cm.encrypt(value));
        }