Esempio n. 1
0
        /// <summary>
        /// 连接到指定的 MS SQL Server 数据库,获取指定目录下的子目录
        /// </summary>
        /// <param name="AListStringArgs">
        /// 0~3 - 数据库连接参数
        /// 4 - 当前路径
        /// </param>
        /// <returns></returns>
        private OperationDataArgs OperationA206(List <string> AListStringArgs)
        {
            OperationDataArgs LOperationReturn = new OperationDataArgs();

            LOperationReturn = DatabaseType2Operation.GetSubdirectories(AListStringArgs);
            return(LOperationReturn);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取数据库中的用户数据库 和 登录名(LoginType = SqlLogin)
        /// </summary>
        /// <param name="AListStringArgs"></param>
        /// <returns></returns>
        private OperationDataArgs OperationA204(List <string> AListStringArgs)
        {
            OperationDataArgs LOperationReturn = new OperationDataArgs();

            LOperationReturn = DatabaseType2Operation.ObtainDatabasesLogins(AListStringArgs);

            return(LOperationReturn);
        }
Esempio n. 3
0
        /// <summary>
        /// 尝试连接到指定的MS SQL Server数据库,且获得当前T_00_000的版本
        /// </summary>
        /// <param name="AListStringArgs"></param>
        /// <returns></returns>
        private OperationDataArgs OperationA205(List <string> AListStringArgs)
        {
            OperationDataArgs LOperationReturn = new OperationDataArgs();

            LOperationReturn = DatabaseType2Operation.Connect2SpecifiedDatabaseObtainCurrentVersion(AListStringArgs);

            return(LOperationReturn);
        }
Esempio n. 4
0
        /// <summary>
        /// 创建数据库登录用户
        /// </summary>
        /// <param name="AListStringArgs"></param>
        /// <returns></returns>
        private OperationDataArgs OperationA203(List <string> AListStringArgs)
        {
            OperationDataArgs LOperationReturn = new OperationDataArgs();

            LOperationReturn = DatabaseType2Operation.CreateLoginAccount(AListStringArgs);

            return(LOperationReturn);
        }
Esempio n. 5
0
        /// <summary>
        /// 连接到MS SQL Server 获取数据库服务器相关配置信息
        /// </summary>
        /// <param name="AListStringArgs"></param>
        /// <returns></returns>
        private OperationDataArgs OperationA201(List <string> AListStringArgs)
        {
            OperationDataArgs LOperationReturn = new OperationDataArgs();

            LOperationReturn = DatabaseType2Operation.ConnectToDatabase(AListStringArgs);

            return(LOperationReturn);
        }
Esempio n. 6
0
        /// <summary>
        /// 初始化表数据
        /// </summary>
        /// <param name="AListStringArgs">
        /// 0-是否已经初始化
        /// 1-数据库类型
        /// 2-数据库服务器
        /// 3-端口
        /// 4-登录名
        /// 5-登录密码
        /// 6-目标数据库
        /// 7-对象类型
        /// 8-对象路径
        /// 9-租户Token
        /// </param>
        /// <returns></returns>
        private OperationDataArgs OperationA14(List <string> AListStringArgs)
        {
            OperationDataArgs LOperationReturn = new OperationDataArgs();

            if (AListStringArgs[0] == "1")
            {
                LOperationReturn.BoolReturn   = true;
                LOperationReturn.StringReturn = AscCodeToChr(27);
                return(LOperationReturn);
            }
            if (AListStringArgs[1] == "2")
            {
                LOperationReturn = DatabaseType2Operation.InitTablesData(AListStringArgs, GetIISBaseDirectory());
            }
            if (AListStringArgs[1] == "3")
            {
                LOperationReturn = DatabaseType3Operation.InitTablesData(AListStringArgs, GetIISBaseDirectory());
            }

            return(LOperationReturn);
        }
Esempio n. 7
0
        /// <summary>
        /// 创建数据库对象
        /// </summary>
        /// <param name="AListStringArgs">
        /// 0-是否已经创建
        /// 1-数据库类型
        /// 2-数据库服务器
        /// 3-端口
        /// 4-登录名
        /// 5-登录密码
        /// 6-目标数据库
        /// 7-对象类型
        /// 8-对象路径
        /// 9-租户Token
        /// <returns></returns>
        private OperationDataArgs OperationA12(List <string> AListStringArgs)
        {
            OperationDataArgs LOperationReturn = new OperationDataArgs();

            if (AListStringArgs[0] == "1")
            {
                LOperationReturn.BoolReturn   = true;
                LOperationReturn.StringReturn = AscCodeToChr(27);
                return(LOperationReturn);
            }

            if (AListStringArgs[1] == "2" && AListStringArgs[7] == "T")
            {
                LOperationReturn = DatabaseType2Operation.CreateObjectTable(AListStringArgs, GetIISBaseDirectory());
            }
            if (AListStringArgs[1] == "2" && AListStringArgs[7] == "F")
            {
                LOperationReturn = DatabaseType2Operation.CreateObjectBySQL(AListStringArgs, GetIISBaseDirectory());
            }
            if (AListStringArgs[1] == "2" && AListStringArgs[7] == "P")
            {
                LOperationReturn = DatabaseType2Operation.CreateObjectBySQL(AListStringArgs, GetIISBaseDirectory());
            }

            if (AListStringArgs[1] == "3" && AListStringArgs[7] == "T")
            {
                LOperationReturn = DatabaseType3Operation.CreateObjectTable(AListStringArgs, GetIISBaseDirectory());
            }
            if (AListStringArgs[1] == "3" && AListStringArgs[7] == "F")
            {
                LOperationReturn = DatabaseType3Operation.CreateObjectBySQL(AListStringArgs, GetIISBaseDirectory());
            }
            if (AListStringArgs[1] == "3" && AListStringArgs[7] == "P")
            {
                LOperationReturn = DatabaseType3Operation.CreateObjectBySQL(AListStringArgs, GetIISBaseDirectory());
            }

            return(LOperationReturn);
        }
Esempio n. 8
0
        /// <summary>
        /// 根据租户信息,更改表中的初始化数据
        /// </summary>
        /// <param name="AListStringArgs">
        /// 0-数据库类型
        /// 1-数据库服务器
        /// 2-端口
        /// 3-登录名
        /// 4-登录密码
        /// 5-数据库名或服务名
        /// 6-0租户名称
        /// 7-1租户Token
        /// 8-2超级系统管理员密码
        /// 9-3系统默认界面显示语言
        /// </param>
        /// <returns></returns>
        private OperationDataArgs OperationA15(List <string> AListStringArgs)
        {
            OperationDataArgs LOperationReturn        = new OperationDataArgs();
            List <string>     LListStrDatabaseProfile = new List <string>();
            List <string>     LListStrRentDataSetted  = new List <string>();

            string LStrXmlFileName         = string.Empty;
            string LStrVerificationCode001 = string.Empty;
            string LStrVerificationCode104 = string.Empty;
            string LStrUserID19            = string.Empty;
            string LStrXmlSAPassword       = string.Empty;
            string LStrA01 = string.Empty;

            try
            {
                for (int LIntLoopTemp = 0; LIntLoopTemp <= 5; LIntLoopTemp++)
                {
                    LListStrDatabaseProfile.Add(AListStringArgs[LIntLoopTemp]);
                }
                for (int LIntLoopTemp = 6; LIntLoopTemp <= 9; LIntLoopTemp++)
                {
                    LListStrRentDataSetted.Add(AListStringArgs[LIntLoopTemp]);
                }

                if (LListStrDatabaseProfile[0] == "2")
                {
                    LOperationReturn = DatabaseType2Operation.InitTableByRentInfo(LListStrDatabaseProfile, LListStrRentDataSetted);
                }
                if (LListStrDatabaseProfile[0] == "3")
                {
                    LOperationReturn = DatabaseType3Operation.InitTableByRentInfo(LListStrDatabaseProfile, LListStrRentDataSetted);
                }

                #region 修改XML文件的administrator的密码
                LStrVerificationCode001 = CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M001);
                LStrVerificationCode104 = CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);
                LStrUserID19            = "102" + AListStringArgs[7] + "00000000001";
                LStrXmlSAPassword       = EncryptionAndDecryption.EncryptDecryptString(AListStringArgs[8], LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                LStrXmlSAPassword       = EncryptionAndDecryption.EncryptStringSHA512(LStrUserID19 + LStrXmlSAPassword, LStrVerificationCode001, EncryptionAndDecryption.UMPKeyAndIVType.M001);
                LStrXmlFileName         = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
                LStrXmlFileName         = Path.Combine(LStrXmlFileName, @"UMP.Server\Args02.UMP.xml");
                XmlDocument LXmlDocArgs02 = new XmlDocument();
                LXmlDocArgs02.Load(LStrXmlFileName);
                XmlNodeList LXmlNodeListSAUsers = LXmlDocArgs02.SelectSingleNode("Parameters02").SelectSingleNode("SAUsers").ChildNodes;
                foreach (XmlNode LXmlNodeSingleUser in LXmlNodeListSAUsers)
                {
                    LStrA01 = LXmlNodeSingleUser.Attributes["A01"].Value;
                    if (LStrA01 != LStrUserID19)
                    {
                        continue;
                    }
                    LXmlNodeSingleUser.Attributes["A03"].Value = LStrXmlSAPassword;
                    break;
                }
                LXmlDocArgs02.Save(LStrXmlFileName);
                #endregion
            }
            catch (Exception ex)
            {
                LOperationReturn.BoolReturn   = false;
                LOperationReturn.StringReturn = "OperationA15()\n" + ex.ToString();
            }

            return(LOperationReturn);
        }