Esempio n. 1
0
        /// <summary>
        /// 初始化SessionInfo,如果应用程序单机运行(不在主模块中运行),此处可设置SessionInfo的默认值
        /// </summary>
        protected virtual void InitSessionInfo()
        {
            Session             = SessionInfo.CreateSessionInfo(AppName, ModuleID, AppType);
            Session.InstallPath = @"C:\UMPRelease";

            RentInfo rentInfo = new RentInfo();

            rentInfo.ID      = ConstValue.RENT_DEFAULT;
            rentInfo.Token   = ConstValue.RENT_DEFAULT_TOKEN;
            rentInfo.Domain  = "voicecyber.com";
            rentInfo.Name    = "voicecyber";
            Session.RentInfo = rentInfo;
            Session.RentID   = ConstValue.RENT_DEFAULT;

            UserInfo userInfo = new UserInfo();

            userInfo.UserID   = ConstValue.USER_ADMIN;
            userInfo.Account  = "administrator";
            userInfo.UserName = "******";
            userInfo.Password = "******";
            Session.UserInfo  = userInfo;
            Session.UserID    = ConstValue.USER_ADMIN;

            RoleInfo roleInfo = new RoleInfo();

            roleInfo.ID      = ConstValue.ROLE_SYSTEMADMIN;
            roleInfo.Name    = "System Admin";
            Session.RoleInfo = roleInfo;
            Session.RoleID   = ConstValue.ROLE_SYSTEMADMIN;

            ThemeInfo themeInfo = new ThemeInfo();

            themeInfo.Name    = "Default";
            themeInfo.Color   = "Brown";
            Session.ThemeInfo = themeInfo;
            Session.ThemeName = "Default";

            themeInfo       = new ThemeInfo();
            themeInfo.Name  = "Style01";
            themeInfo.Color = "Green";
            Session.SupportThemes.Add(themeInfo);

            themeInfo       = new ThemeInfo();
            themeInfo.Name  = "Style02";
            themeInfo.Color = "Yellow";
            Session.SupportThemes.Add(themeInfo);

            themeInfo       = new ThemeInfo();
            themeInfo.Name  = "Style03";
            themeInfo.Color = "Brown";
            Session.SupportThemes.Add(themeInfo);

            themeInfo       = new ThemeInfo();
            themeInfo.Name  = "Style04";
            themeInfo.Color = "Blue";
            Session.SupportThemes.Add(themeInfo);

            LangTypeInfo langType = new LangTypeInfo();

            langType.LangID   = 1033;
            langType.LangName = "en-us";
            langType.Display  = "English";
            Session.SupportLangTypes.Add(langType);

            langType          = new LangTypeInfo();
            langType.LangID   = 2052;
            langType.LangName = "zh-cn";
            langType.Display  = "简体中文";
            Session.SupportLangTypes.Add(langType);
            Session.LangTypeInfo = langType;
            Session.LangTypeID   = langType.LangID;

            langType          = new LangTypeInfo();
            langType.LangID   = 1028;
            langType.LangName = "zh-cn";
            langType.Display  = "繁体中文";
            Session.SupportLangTypes.Add(langType);
        }
Esempio n. 2
0
        private void InitSessionInfo()
        {
            Session = SessionInfo.CreateSessionInfo(AppName, ModuleID, AppType);
            RentInfo rentInfo = new RentInfo();

            rentInfo.ID      = ConstValue.RENT_DEFAULT;
            rentInfo.Token   = ConstValue.RENT_DEFAULT_TOKEN;
            rentInfo.Domain  = "voicecyber.com";
            rentInfo.Name    = "voicecyber";
            Session.RentInfo = rentInfo;
            Session.RentID   = ConstValue.RENT_DEFAULT;

            UserInfo userInfo = new UserInfo();

            userInfo.UserID   = ConstValue.USER_ADMIN;
            userInfo.Account  = "administrator";
            userInfo.UserName = "******";
            Session.UserInfo  = userInfo;
            Session.UserID    = ConstValue.USER_ADMIN;

            RoleInfo roleInfo = new RoleInfo();

            roleInfo.ID      = ConstValue.ROLE_SYSTEMADMIN;
            roleInfo.Name    = "System Admin";
            Session.RoleInfo = roleInfo;
            Session.RoleID   = ConstValue.ROLE_SYSTEMADMIN;


            ThemeInfo themeInfo = new ThemeInfo();

            themeInfo.Name  = "Style01";
            themeInfo.Color = "Green";
            Session.SupportThemes.Add(themeInfo);

            themeInfo       = new ThemeInfo();
            themeInfo.Name  = "Style02";
            themeInfo.Color = "Yellow";
            Session.SupportThemes.Add(themeInfo);

            themeInfo       = new ThemeInfo();
            themeInfo.Name  = "Style03";
            themeInfo.Color = "Brown";
            Session.SupportThemes.Add(themeInfo);

            themeInfo       = new ThemeInfo();
            themeInfo.Name  = "Style04";
            themeInfo.Color = "Blue";
            Session.SupportThemes.Add(themeInfo);


            #region Set Default Theme

            string   themeName = "Style01";
            DateTime now       = DateTime.Now;
            if (now.Month == 3 ||
                now.Month == 4 ||
                now.Month == 5)
            {
                themeName = "Style01";
            }
            if (now.Month == 6 ||
                now.Month == 7 ||
                now.Month == 8)
            {
                themeName = "Style02";
            }
            if (now.Month == 9 ||
                now.Month == 10 ||
                now.Month == 11)
            {
                themeName = "Style03";
            }
            if (now.Month == 12 ||
                now.Month == 1 ||
                now.Month == 2)
            {
                themeName = "Style04";
            }
            var theme = Session.SupportThemes.FirstOrDefault(t => t.Name == themeName);
            if (theme != null)
            {
                Session.ThemeInfo = theme;
                Session.ThemeName = themeName;
            }

            #endregion


            LangTypeInfo langType = new LangTypeInfo();
            langType.LangID   = 1033;
            langType.LangName = "en-us";
            langType.Display  = "English";
            Session.SupportLangTypes.Add(langType);

            langType          = new LangTypeInfo();
            langType.LangID   = 2052;
            langType.LangName = "zh-cn";
            langType.Display  = "简体中文";
            Session.SupportLangTypes.Add(langType);
            Session.LangTypeInfo = langType;
            Session.LangTypeID   = langType.LangID;

            langType          = new LangTypeInfo();
            langType.LangID   = 1028;
            langType.LangName = "zh-cn";
            langType.Display  = "繁体中文";
            Session.SupportLangTypes.Add(langType);

            langType          = new LangTypeInfo();
            langType.LangID   = 1041;
            langType.LangName = "jp";
            langType.Display  = "日本语";
            Session.SupportLangTypes.Add(langType);

            langType          = new LangTypeInfo();
            langType.LangID   = 1025;
            langType.LangName = "ara";
            langType.Display  = "阿拉伯语";
            Session.SupportLangTypes.Add(langType);


            #region Set Default Language

            int langID = GetUserDefaultUILanguage();
            var lang   = Session.SupportLangTypes.FirstOrDefault(l => l.LangID == langID);
            if (lang != null)
            {
                Session.LangTypeInfo = lang;
                Session.LangTypeID   = lang.LangID;
            }

            #endregion


            AppServerInfo appServerInfo = new AppServerInfo();
            appServerInfo.Protocol      = "http";
            appServerInfo.Address       = "192.168.6.78";
            appServerInfo.Port          = 8081;
            appServerInfo.SupportHttps  = false;
            appServerInfo.SupportNetTcp = false;
            Session.AppServerInfo       = appServerInfo;

            DatabaseInfo dbInfo = new DatabaseInfo();
            dbInfo.TypeID    = 2;
            dbInfo.Host      = "192.168.4.182";
            dbInfo.Port      = 1433;
            dbInfo.DBName    = "UMPDataDB11251";
            dbInfo.LoginName = "PFDEV";
            string strPassword = "******";
            dbInfo.RealPassword = strPassword;
            strPassword         = EncryptString(strPassword);
            dbInfo.Password     = strPassword;

            Session.DatabaseInfo = dbInfo;
            Session.DBType       = dbInfo.TypeID;

            Session.AppVersion = "8.03.002";
        }
Esempio n. 3
0
        private void InitSessionInfo()
        {
            mSession = SessionInfo.CreateSessionInfo("Demo", 0, (int)AppType.UMPClient);
            RentInfo rentInfo = new RentInfo();

            rentInfo.ID       = ConstValue.RENT_DEFAULT;
            rentInfo.Token    = ConstValue.RENT_DEFAULT_TOKEN;
            rentInfo.Domain   = "voicecyber.com";
            rentInfo.Name     = "voicecyber";
            mSession.RentInfo = rentInfo;
            mSession.RentID   = ConstValue.RENT_DEFAULT;

            UserInfo userInfo = new UserInfo();

            userInfo.UserID   = ConstValue.USER_ADMIN;
            userInfo.Account  = "administrator";
            userInfo.UserName = "******";
            userInfo.Password = "******";
            mSession.UserInfo = userInfo;
            mSession.UserID   = ConstValue.USER_ADMIN;

            RoleInfo roleInfo = new RoleInfo();

            roleInfo.ID       = ConstValue.ROLE_SYSTEMADMIN;
            roleInfo.Name     = "System Admin";
            mSession.RoleInfo = roleInfo;
            mSession.RoleID   = ConstValue.ROLE_SYSTEMADMIN;

            ThemeInfo themeInfo = new ThemeInfo();

            themeInfo.Name     = "Style01";
            themeInfo.Color    = "Green";
            mSession.ThemeInfo = themeInfo;
            mSession.ThemeName = "Style01";

            themeInfo       = new ThemeInfo();
            themeInfo.Name  = "Style01";
            themeInfo.Color = "Green";
            mSession.SupportThemes.Add(themeInfo);

            themeInfo       = new ThemeInfo();
            themeInfo.Name  = "Style02";
            themeInfo.Color = "Yellow";
            mSession.SupportThemes.Add(themeInfo);

            themeInfo       = new ThemeInfo();
            themeInfo.Name  = "Style03";
            themeInfo.Color = "Brown";
            mSession.SupportThemes.Add(themeInfo);

            themeInfo       = new ThemeInfo();
            themeInfo.Name  = "Style04";
            themeInfo.Color = "Blue";
            mSession.SupportThemes.Add(themeInfo);

            LangTypeInfo langType = new LangTypeInfo();

            langType.LangID   = 1033;
            langType.LangName = "en-us";
            langType.Display  = "English";
            mSession.SupportLangTypes.Add(langType);

            langType          = new LangTypeInfo();
            langType.LangID   = 2052;
            langType.LangName = "zh-cn";
            langType.Display  = "简体中文";
            mSession.SupportLangTypes.Add(langType);
            mSession.LangTypeInfo = langType;
            mSession.LangTypeID   = langType.LangID;

            langType          = new LangTypeInfo();
            langType.LangID   = 1028;
            langType.LangName = "zh-cn";
            langType.Display  = "繁体中文";
            mSession.SupportLangTypes.Add(langType);

            AppServerInfo appServerInfo = new AppServerInfo();

            appServerInfo.Protocol      = "http";
            appServerInfo.Address       = "192.168.6.63";
            appServerInfo.Port          = 8081;
            appServerInfo.SupportHttps  = false;
            appServerInfo.SupportNetTcp = false;
            mSession.AppServerInfo      = appServerInfo;

            //DatabaseInfo dbInfo = new DatabaseInfo();
            //dbInfo.TypeID = 2;
            //dbInfo.Host = "192.168.4.182";
            //dbInfo.Port = 1433;
            //dbInfo.DBName = "UMPDataDB0304";
            //dbInfo.LoginName = "PFDEV";
            //dbInfo.Password = "******";
            //mSession.DatabaseInfo = dbInfo;
            //mSession.DBType = dbInfo.TypeID;
            //mSession.DBConnectionString = dbInfo.GetConnectionString();

            DatabaseInfo dbInfo = new DatabaseInfo();

            dbInfo.TypeID               = 3;
            dbInfo.Host                 = "192.168.4.182";
            dbInfo.Port                 = 1521;
            dbInfo.DBName               = "PFOrcl";
            dbInfo.LoginName            = "pfdev832";
            dbInfo.Password             = "******";
            dbInfo.RealPassword         = "******";
            mSession.DatabaseInfo       = dbInfo;
            mSession.DBType             = dbInfo.TypeID;
            mSession.DBConnectionString = dbInfo.GetConnectionString();
        }