using irisHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace irisMemory
{
    public class DbServerConfig
    {
        //obdc
        private string serverIp;
        private string serverDatabasePort;
        private string serverDatabaseName;
        private string serverDatabaseUser;
        private string serverDatabasePassword;

        private string serverAppPort;
        private string listenPort;

        public string ServerIp
        {
            get
            {
                return serverIp;
            }

            set
            {
                serverIp = value;
            }
        }

        public string ServerDatabasePort
        {
            get
            {
                return serverDatabasePort;
            }

            set
            {
                serverDatabasePort = value;
            }
        }

        public string ServerDatabaseName
        {
            get
            {
                return serverDatabaseName;
            }

            set
            {
                serverDatabaseName = value;
            }
        }

        public string ServerDatabaseUser
        {
            get
            {
                return serverDatabaseUser;
            }

            set
            {
                serverDatabaseUser = value;
            }
        }

        public string ServerDatabasePassword
        {
            get
            {
                return serverDatabasePassword;
            }

            set
            {
                serverDatabasePassword = value;
            }
        }

        public string ServerAppPort
        {
            get
            {
                return serverAppPort;
            }

            set
            {
                serverAppPort = value;
            }
        }

        public string ListenPort
        {
            get
            {
                return listenPort;
            }

            set
            {
                listenPort = value;
            }
        }

        public DbServerConfig InitDbServerConfig()
        {
            DbServerConfig serverConfig = new DbServerConfig();
            serverConfig.ServerIp = ConfigHelper.GetAppConfig("serverIp");
            serverConfig.ServerDatabasePort = ConfigHelper.GetAppConfig("serverDatabasePort");
            serverConfig.ServerDatabaseName = ConfigHelper.GetAppConfig("serverDatabaseName");
            serverConfig.ServerDatabaseUser = ConfigHelper.GetAppConfig("serverDatabaseUser");
            serverConfig.ServerDatabasePassword = ConfigHelper.GetAppConfig("serverDatabasePassword");

            serverConfig.ServerAppPort = ConfigHelper.GetAppConfig("serverAppPort");
            serverConfig.ListenPort = ConfigHelper.GetAppConfig("listenPort");
            return serverConfig;
        }

    }
}