public string GetSetting(string settingName)
        {
            string            value   = string.Empty;
            dia_configuration setting = OrgServiceContext.dia_configurationSet.Where(x => x.dia_name == settingName && x.statecode == dia_configurationState.Active)
                                        .FirstOrDefault <dia_configuration>();

            if (setting != null)
            {
                value = setting.dia_value;
                if (setting.dia_enrcypt.HasValue && setting.dia_enrcypt.Value)
                {
                    value = EncryptionHelper.Decrypt(value);
                }
            }
            return(value);
        }
        public void EncryptSetting(dia_configuration config, dia_configuration preImage)
        {
            if (config.dia_enrcypt == preImage?.dia_enrcypt && config.dia_value == preImage?.dia_value)
            {
                Trace("Value or Encrypt Flag not changed");
                return;
            }
            string value   = config.dia_value ?? preImage?.dia_value;
            bool?  encrypt = config.dia_enrcypt ?? preImage?.dia_enrcypt;

            if (string.IsNullOrWhiteSpace(value))
            {
                Trace("Value Is Null");
                return;
            }
            if (!encrypt.HasValue || !encrypt.Value)
            {
                Trace("Encrypt Flag Is Null or False");
                return;
            }
            string encryptedString = EncryptionHelper.Encrypt(value);

            config.dia_value = encryptedString;
        }