Beispiel #1
0
 public void Execute()
 {
     var ds = accountBal.GetListAccount();
     for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
     {
         var salt = CreateSalt();
         var account = new Account()
         {
             ID = int.Parse(ds.Tables[0].Rows[i][0].ToString()),
             Username = ds.Tables[0].Rows[i][1].ToString(),
             Password = GenerateHash(ds.Tables[0].Rows[i][2].ToString(), salt),
             Salt = salt,
             Email = ds.Tables[0].Rows[i][3].ToString(),
             CrearedDateTime =
                 GenerateDateTime(Convert.ToDateTime(ds.Tables[0].Rows[i][4]).ToString("yyyy-MM-dd"),
                     ds.Tables[0].Rows[i][5].ToString()),
         };
         accountBal.InsertAccount(account);
         Console.WriteLine(account.ID);
     }
 }