Exemplo n.º 1
0
 public Error.Types PhysicalDelete(
     Sqls.TableTypes tableType = Sqls.TableTypes.Normal)
 {
     Rds.ExecuteNonQuery(
         transactional: true,
         statements: Rds.PhysicalDeleteDemos(
             tableType: tableType,
             param: Rds.DemosParam().DemoId(DemoId)));
     return(Error.Types.None);
 }
Exemplo n.º 2
0
 public ErrorData PhysicalDelete(
     Context context, Sqls.TableTypes tableType = Sqls.TableTypes.Normal)
 {
     Rds.ExecuteNonQuery(
         context: context,
         transactional: true,
         statements: Rds.PhysicalDeleteDemos(
             tableType: tableType,
             param: Rds.DemosParam().DemoId(DemoId)));
     return(new ErrorData(type: Error.Types.None));
 }
Exemplo n.º 3
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);
        }
 /// <summary>
 /// Fixed:
 /// </summary>
 private static void Initialize(
     this DemoModel demoModel, Dictionary <string, long> idHash, string password)
 {
     demoModel.InitializeTimeLag();
     InitializeDepts(demoModel, idHash);
     InitializeUsers(demoModel, idHash, password);
     SiteInfo.Reflesh(force: true);
     InitializeSites(demoModel, idHash);
     Def.DemoDefinitionCollection
     .Where(o => o.Type == "Sites")
     .OrderBy(o => o.Id)
     .ForEach(o =>
     {
         InitializeIssues(demoModel, o.Id, idHash);
         InitializeResults(demoModel, o.Id, idHash);
     });
     InitializeLinks(demoModel, idHash);
     InitializePermissions(idHash);
     Rds.ExecuteNonQuery(statements: Rds.UpdateDemos(
                             param: Rds.DemosParam().Initialized(true),
                             where : Rds.DemosWhere().Passphrase(demoModel.Passphrase)));
     Libraries.Migrators.SiteSettingsMigrator.Migrate();
 }