Exemple #1
0
        /// <summary>
        /// Fixed:
        /// </summary>
        private static void Initialize(
            this DemoModel demoModel,
            Context context,
            Dictionary <string, long> idHash,
            string password)
        {
            demoModel.InitializeTimeLag();
            InitializeDepts(
                context: context,
                demoModel: demoModel,
                idHash: idHash);
            InitializeUsers(
                context: context,
                demoModel: demoModel,
                idHash: idHash,
                password: password);
            var userModel = new UserModel(
                context: context,
                ss: SiteSettingsUtilities.UsersSiteSettings(context: context),
                loginId: LoginId(demoModel, "User1"));

            userModel.SetSession();
            context.SetBySession();
            SiteInfo.Reflesh(context: context);
            InitializeSites(context: context, demoModel: demoModel, idHash: idHash);
            Def.DemoDefinitionCollection
            .Where(o => o.Type == "Sites")
            .OrderBy(o => o.Id)
            .ForEach(o =>
            {
                InitializeIssues(
                    context: context, demoModel: demoModel, parentId: o.Id, idHash: idHash);
                InitializeResults(
                    context: context, demoModel: demoModel, parentId: o.Id, idHash: idHash);
            });
            InitializeLinks(
                context: context,
                demoModel: demoModel,
                idHash: idHash);
            InitializePermissions(
                context: context,
                idHash: idHash);
            Rds.ExecuteNonQuery(
                context: context,
                statements: Rds.UpdateDemos(
                    param: Rds.DemosParam().Initialized(true),
                    where : Rds.DemosWhere().Passphrase(demoModel.Passphrase)));
            Libraries.Migrators.SiteSettingsMigrator.Migrate(context: context);
        }