Exemple #1
0
        public override void Up()
        {
            var user = M3User.Create(UserName, DevPassword, "Customer",
                                     new M1Profile()
            {
                Email                = "*****@*****.**",
                FirstName            = "Chuck",
                LastName             = "Norris",
                PhoneNumber          = "+375296140302",
                PhoneNumberConfirmed = true
            }
                                     );

            InsertUser(user);
            InsertClaims(user);
            InsertProfile(user);

            Execute.WithConnection((connection, transaction) =>
            {
                var nowUtc    = DateTime.UtcNow;
                var expireUtc = nowUtc.AddYears(10);
                var id        = GetUserId(connection, transaction, UserName);
                var accountNo = "3014" + Seed.RandomStringOfNumbers(9);
                var account   = M2Account.Create(accountNo, "USD", 999999999, nowUtc, expireUtc, "CardAccount");
                var card1     = M2Card.Create(accountNo, id, UserName);
                var card2     = M2Card.Create(accountNo, id, UserName);
                InsertAccount(account, connection, transaction);
                InsertUserAccount(account.ToUserAccount(id), connection, transaction);
                InsertCard(card1, connection, transaction);
                InsertCard(card2, connection, transaction);
            });
        }
 public override void Up()
 {
     Execute.WithConnection((connection, transaction) =>
     {
         var nowUtc    = DateTime.UtcNow;
         var expireUtc = nowUtc.AddYears(1);
         foreach (var idPair in GetUserIdPairs(connection, transaction))
         {
             var accountNo = "3014" + Seed.RandomStringOfNumbers(9);
             var account   = M2Account.Create(accountNo, "USD", 10000, nowUtc, expireUtc, "CardAccount");
             var card      = M2Card.Create(accountNo, idPair.UserId, idPair.UserName);
             InsertAccount(account, connection, transaction);
             InsertUserAccount(account.ToUserAccount(idPair.UserId), connection, transaction);
             InsertCard(card, connection, transaction);
         }
     });
 }