Exemplo n.º 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));
        }
Exemplo n.º 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("");
     }
 }
Exemplo n.º 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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
        protected string Decrypt(string encrypted_value)
        {
            CryptorManager cm = CryptorManager.Instance;

            return(cm.decrypt(encrypted_value));
        }
Exemplo n.º 6
0
        protected string Encrypt(string value)
        {
            CryptorManager cm = CryptorManager.Instance;

            return(cm.encrypt(value));
        }