Пример #1
0
        public void UpdateLicense()
        {
            var sqlmap     = new SQLMapFactory(this.DBServer, this.DBUser, this.DBPassword, this.DBName).GetSQLMap(this.DatabaseType);
            var connection = new dbConnectionFactory(this.DBServer, this.DBUser, this.DBPassword, this.DBName).GetDBConnection(sqlmap);
            ServiceInformationCreator ServiceInforC = new ServiceInformationCreator();

            ServiceInforC.SetDBConnection(connection);
            ServiceInforC.MyAppsetting = this;
            ServiceInforC.RootAddress  = this.IISAddress + ":" + this.IISPort;
            ServiceInforC.WorkFolder   = this.InstallDiraddress;
            var list = ServiceInforC.GetServiceInformations();

            Licenses.Company               = "需手动填写";
            Licenses.Contacts              = "需手动填写";
            Licenses.eMail                 = "需手动填写";
            Licenses.ExpirationDate        = new DateTime(2099, 12, 31);
            Licenses.LicensedComputerCodes = new string[] { ComputerCode.GetCode() };
            Licenses.LicensedDataBases     = new string[] { this.DBName };
            Licenses.UserCount             = 50;
            var ModuleList = new List <string>();

            foreach (var item in list)
            {
                ModuleList.Add(string.Format("{0}|{1}", item.ModuleID, item.ServiceDescription));
            }
            Licenses.LicensedModules = ModuleList.ToArray();
        }
        public override void Excute()
        {
            var sqlmap     = new SQLMapFactory(this.AppSetting.DBServer, this.AppSetting.DBUser, this.AppSetting.DBPassword, this.AppSetting.DBName).GetSQLMap(this.AppSetting.DatabaseType);
            var connection = new dbConnectionFactory(this.AppSetting.DBServer, this.AppSetting.DBUser, this.AppSetting.DBPassword, this.AppSetting.DBName).GetDBConnection(sqlmap);
            ServiceInformationCreator ServiceInforC = new ServiceInformationCreator();

            ServiceInforC.SetDBConnection(connection);
            ServiceInforC.MyAppsetting = this.AppSetting;
            ServiceInforC.RootAddress  = this.AppSetting.IISAddress + ":" + this.AppSetting.IISPort;
            ServiceInforC.WorkFolder   = this.AppSetting.InstallDiraddress;
            ServiceInforC.CreateWebConfig();
        }