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)); }
public string GetParamValue(string name) { if (ParamExists(name)) { Config _obj = FindByParamName(name); CryptorManager cm = CryptorManager.Instance; return(cm.decrypt(_obj.ConfigValue)); } else { return(""); } }
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)); }
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); }
protected string Decrypt(string encrypted_value) { CryptorManager cm = CryptorManager.Instance; return(cm.decrypt(encrypted_value)); }
protected string Encrypt(string value) { CryptorManager cm = CryptorManager.Instance; return(cm.encrypt(value)); }