예제 #1
0
파일: Program.cs 프로젝트: ppetrov/Cchbc
 private static void Replicate(string serverDb, ClientData data, string user, string version, ServerData serverData)
 {
     using (var server = new TransactionContextCreator(serverDb).Create())
     {
         FeatureServerManager.Replicate(user, version, server, data, serverData);
         server.Complete();
     }
 }
예제 #2
0
파일: Program.cs 프로젝트: ppetrov/Cchbc
        private static void Replicate(string serverDb, ClientData data, ServerData serverData)
        {
            var versions = new[]
            {
                @"8.28.79.127",
                @"7.74.19.727",
                @"6.22.29.492",
                @"5.96.69.792",
                @"4.11.27.292",
                @"3.85.19.223",
            };

            using (var ctx = new TransactionContextCreator(serverDb).Create())
            {
                for (var i = 11; i < 120; i++)
                {
                    var user = @"BG" + (i.ToString()).PadLeft(6, '0');

                    if (_r.Next(0, 10) == 0)
                    {
                        continue;
                    }

                    //Replicate(serverDb, data, user, versions[_r.Next(versions.Length)], serverData);
                    var version = versions[_r.Next(versions.Length)];

                    //Replicate(serverDb, data, user, version, serverData);

                    FeatureServerManager.Replicate(user, version, ctx, data, serverData);
                }
                ctx.Complete();
            }
        }