using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace digioz
{
    public class PortalSettingsManagement
    {
        public PortalSettingsManagement()
        { }

        public static PortalSettings GetPortalSettings()
        {
            PortalSettings loPortalSettings = new PortalSettings();
            string lsRelational = String.Empty;

            loPortalSettings.DBHost = ConfigurationManager.AppSettings["dbhostkey"];
            loPortalSettings.DBName = ConfigurationManager.AppSettings["dbnamekey"];
            loPortalSettings.DBUser = ConfigurationManager.AppSettings["dbuserkey"];
            loPortalSettings.DBPass = ConfigurationManager.AppSettings["dbpasskey"];
            loPortalSettings.DBType = ConfigurationManager.AppSettings["DBType"];
            lsRelational = ConfigurationManager.AppSettings["DBRelational"];
            if (lsRelational == "1") { loPortalSettings.DBRelational = true; } else { loPortalSettings.DBRelational = false; }
            loPortalSettings.ConnectionString = ConfigurationManager.AppSettings["dbconnectionstring"];
            loPortalSettings.EncryptionKey = ConfigurationManager.AppSettings["DBEncryptKey"];
            loPortalSettings.EncryptionVector = ConfigurationManager.AppSettings["DBEncryptVector"];
            loPortalSettings.URLEncryptionKey = ConfigurationManager.AppSettings["URLEncryptKey"];
            //csEncryptionSalt = ConfigurationManager.AppSettings["URLEncryptSalt"];

            return loPortalSettings;
        }
    }
}
