コード例 #1
0
 private static AccountDTO GenerateAccount(SqlDataReader reader, AccountDTO account, AddressDTO address)
 {
     if (reader["addressID"] != DBNull.Value)
     {
         address.SetID(Convert.ToInt32(reader["addressID"]));
         Debug.Print("AccountDAL / GenerateAccount: " + address.GetID());
         account.SetAddress(address);
     }
     account.SetID(Convert.ToInt32(reader["accountID"]));
     account.SetEmail(reader["email"].ToString());
     account.SetPw((byte[])reader["md5pw"]);
     account.SetSalt((byte[])reader["salt"]);
     account.SetFirstName(reader["firstName"].ToString());
     account.SetLastName(reader["lastName"].ToString());
     account.SetBirthdate(Convert.ToDateTime(reader["birthDate"]));
     account.SetPhoneNo(reader["phone"].ToString());
     account.SetImgPath(reader["imgPath"].ToString());
     account.SetIsAdmin(Convert.ToByte(reader["isAdmin"]));
     account.SetIsConfirmed(Convert.ToByte(reader["isConfirmed"]));
     account.SetConfirmationID(Convert.ToInt32(reader["confirmationID"]));
     account.SetStatus(Convert.ToByte(reader["status"]));
     return(account);
 }