예제 #1
0
        /// <summary>
        /// Builds a data object from the current row in a data reader..
        /// </summary>
        /// <param name="dataReader">Container for database row.</param>
        /// <returns>Data object built from current row.</returns>
        private static GolferData GetDataObjectFromReader(SqlDataReader dataReader)
        {
            GolferData data = new GolferData();

            if (dataReader.IsDBNull(dataReader.GetOrdinal("GolferId")))
            {
                data.GolferId = IdType.UNSET;
            }
            else
            {
                data.GolferId = new IdType(dataReader.GetInt32(dataReader.GetOrdinal("GolferId")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("FirstName")))
            {
                data.FirstName = StringType.UNSET;
            }
            else
            {
                data.FirstName = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("FirstName")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("MiddleInitial")))
            {
                data.MiddleInitial = StringType.UNSET;
            }
            else
            {
                data.MiddleInitial = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("MiddleInitial")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("LastName")))
            {
                data.LastName = StringType.UNSET;
            }
            else
            {
                data.LastName = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("LastName")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Phone")))
            {
                data.Phone = StringType.UNSET;
            }
            else
            {
                data.Phone = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Phone")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Email")))
            {
                data.Email = StringType.UNSET;
            }
            else
            {
                data.Email = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Email")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Address1")))
            {
                data.Address.Address1 = StringType.UNSET;
            }
            else
            {
                data.Address.Address1 = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Address1")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Address2")))
            {
                data.Address.Address2 = StringType.UNSET;
            }
            else
            {
                data.Address.Address2 = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Address2")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("City")))
            {
                data.Address.City = StringType.UNSET;
            }
            else
            {
                data.Address.City = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("City")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("State")))
            {
                data.Address.State = USStateCodeEnum.UNSET;
            }
            else
            {
                data.Address.State = USStateCodeEnum.GetInstance(dataReader.GetString(dataReader.GetOrdinal("State")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Country")))
            {
                data.Address.Country = StringType.UNSET;
            }
            else
            {
                data.Address.Country = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Country")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("PostalCode")))
            {
                data.Address.PostalCode = StringType.UNSET;
            }
            else
            {
                data.Address.PostalCode = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("PostalCode")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("DateOfBirth")))
            {
                data.DateOfBirth = DateType.UNSET;
            }
            else
            {
                data.DateOfBirth = new DateType(dataReader.GetDateTime(dataReader.GetOrdinal("DateOfBirth")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Handicap")))
            {
                data.Handicap = DecimalType.UNSET;
            }
            else
            {
                data.Handicap = new DecimalType(dataReader.GetDecimal(dataReader.GetOrdinal("Handicap")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("CourseNumber")))
            {
                data.CourseNumber = StringType.UNSET;
            }
            else
            {
                data.CourseNumber = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("CourseNumber")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("PlayerNumber")))
            {
                data.PlayerNumber = StringType.UNSET;
            }
            else
            {
                data.PlayerNumber = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("PlayerNumber")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Gender")))
            {
                data.Gender = GenderType.UNSET;
            }
            else
            {
                data.Gender = GenderType.GetInstance(dataReader.GetString(dataReader.GetOrdinal("Gender")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("GolferStatus")))
            {
                data.GolferStatus = GolferStatusEnum.UNSET;
            }
            else
            {
                data.GolferStatus = GolferStatusEnum.GetInstance(dataReader.GetString(dataReader.GetOrdinal("GolferStatus")));
            }

            return(data);
        }
예제 #2
0
        /// <summary>
        /// Builds a data object from the current row in a data reader..
        /// </summary>
        /// <param name="dataReader">Container for database row.</param>
        /// <returns>Data object built from current row.</returns>
        private static PaymentData GetDataObjectFromReader(SqlDataReader dataReader)
        {
            PaymentData data = new PaymentData();

            if (dataReader.IsDBNull(dataReader.GetOrdinal("PaymentId")))
            {
                data.PaymentId = IdType.UNSET;
            }
            else
            {
                data.PaymentId = new IdType(dataReader.GetInt32(dataReader.GetOrdinal("PaymentId")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("TournamentId")))
            {
                data.Tournament.TournamentId = IdType.UNSET;
            }
            else
            {
                data.Tournament.TournamentId = new IdType(dataReader.GetInt32(dataReader.GetOrdinal("TournamentId")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("AuthorizationNumber")))
            {
                data.AuthorizationNumber = StringType.UNSET;
            }
            else
            {
                data.AuthorizationNumber = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("AuthorizationNumber")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("ReferenceNumber")))
            {
                data.ReferenceNumber = StringType.UNSET;
            }
            else
            {
                data.ReferenceNumber = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("ReferenceNumber")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("TransactionNumber")))
            {
                data.TransactionNumber = StringType.UNSET;
            }
            else
            {
                data.TransactionNumber = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("TransactionNumber")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Amount")))
            {
                data.Amount = CurrencyType.UNSET;
            }
            else
            {
                data.Amount = new CurrencyType(dataReader.GetDecimal(dataReader.GetOrdinal("Amount")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("ProcessDate")))
            {
                data.ProcessDate = DateType.UNSET;
            }
            else
            {
                data.ProcessDate = new DateType(dataReader.GetDateTime(dataReader.GetOrdinal("ProcessDate")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("PaymentStatus")))
            {
                data.PaymentStatus = PaymentStatusEnum.UNSET;
            }
            else
            {
                data.PaymentStatus = PaymentStatusEnum.GetInstance(dataReader.GetString(dataReader.GetOrdinal("PaymentStatus")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("GolferId")))
            {
                data.Golfer.GolferId = IdType.UNSET;
            }
            else
            {
                data.Golfer.GolferId = new IdType(dataReader.GetInt32(dataReader.GetOrdinal("GolferId")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("CreditCardNumber")))
            {
                data.CreditCard.Number = StringType.UNSET;
            }
            else
            {
                data.CreditCard.Number = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("CreditCardNumber")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("ExpirationDate")))
            {
                data.CreditCard.ExpirationDate = DateType.UNSET;
            }
            else
            {
                data.CreditCard.ExpirationDate = new DateType(Spring2.Core.Util.DateUtil.ToDateTimeFromCreditCardDate(dataReader.GetString(dataReader.GetOrdinal("ExpirationDate"))));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("CardholderName")))
            {
                data.CreditCard.Name = StringType.UNSET;
            }
            else
            {
                data.CreditCard.Name = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("CardholderName")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Address1")))
            {
                data.CreditCard.Address.Address1 = StringType.UNSET;
            }
            else
            {
                data.CreditCard.Address.Address1 = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Address1")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Address2")))
            {
                data.CreditCard.Address.Address2 = StringType.UNSET;
            }
            else
            {
                data.CreditCard.Address.Address2 = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Address2")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("City")))
            {
                data.CreditCard.Address.City = StringType.UNSET;
            }
            else
            {
                data.CreditCard.Address.City = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("City")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("State")))
            {
                data.CreditCard.Address.State = USStateCodeEnum.UNSET;
            }
            else
            {
                data.CreditCard.Address.State = USStateCodeEnum.GetInstance(dataReader.GetString(dataReader.GetOrdinal("State")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Country")))
            {
                data.CreditCard.Address.Country = StringType.UNSET;
            }
            else
            {
                data.CreditCard.Address.Country = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Country")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("PostalCode")))
            {
                data.CreditCard.Address.PostalCode = StringType.UNSET;
            }
            else
            {
                data.CreditCard.Address.PostalCode = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("PostalCode")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("ConfirmationCode")))
            {
                data.ConfirmationCode = StringType.UNSET;
            }
            else
            {
                data.ConfirmationCode = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("ConfirmationCode")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("PaymentDate")))
            {
                data.PaymentDate = DateType.UNSET;
            }
            else
            {
                data.PaymentDate = new DateType(dataReader.GetDateTime(dataReader.GetOrdinal("PaymentDate")));
            }

            return(data);
        }
예제 #3
0
        /// <summary>
        /// Builds a data object from the current row in a data reader..
        /// </summary>
        /// <param name="dataReader">Container for database row.</param>
        /// <returns>Data object built from current row.</returns>
        private static OrganizerData GetDataObjectFromReader(SqlDataReader dataReader)
        {
            OrganizerData data = new OrganizerData();

            if (dataReader.IsDBNull(dataReader.GetOrdinal("OrganizerId")))
            {
                data.OrganizerId = IdType.UNSET;
            }
            else
            {
                data.OrganizerId = new IdType(dataReader.GetInt32(dataReader.GetOrdinal("OrganizerId")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Name")))
            {
                data.Name = StringType.UNSET;
            }
            else
            {
                data.Name = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Name")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Address1")))
            {
                data.Address.Address1 = StringType.UNSET;
            }
            else
            {
                data.Address.Address1 = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Address1")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Address2")))
            {
                data.Address.Address2 = StringType.UNSET;
            }
            else
            {
                data.Address.Address2 = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Address2")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("City")))
            {
                data.Address.City = StringType.UNSET;
            }
            else
            {
                data.Address.City = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("City")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("State")))
            {
                data.Address.State = USStateCodeEnum.UNSET;
            }
            else
            {
                data.Address.State = USStateCodeEnum.GetInstance(dataReader.GetString(dataReader.GetOrdinal("State")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("Country")))
            {
                data.Address.Country = StringType.UNSET;
            }
            else
            {
                data.Address.Country = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("Country")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("PostalCode")))
            {
                data.Address.PostalCode = StringType.UNSET;
            }
            else
            {
                data.Address.PostalCode = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("PostalCode")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("OrganizerContactName")))
            {
                data.OrganizerContact.Name = StringType.UNSET;
            }
            else
            {
                data.OrganizerContact.Name = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("OrganizerContactName")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("OrganizerContactPhone")))
            {
                data.OrganizerContact.Phone = StringType.UNSET;
            }
            else
            {
                data.OrganizerContact.Phone = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("OrganizerContactPhone")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("OrganizerContactEmail")))
            {
                data.OrganizerContact.Email = StringType.UNSET;
            }
            else
            {
                data.OrganizerContact.Email = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("OrganizerContactEmail")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("TechnicalContactName")))
            {
                data.TechnicalContact.Name = StringType.UNSET;
            }
            else
            {
                data.TechnicalContact.Name = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("TechnicalContactName")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("TechnicalContactPhone")))
            {
                data.TechnicalContact.Phone = StringType.UNSET;
            }
            else
            {
                data.TechnicalContact.Phone = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("TechnicalContactPhone")));
            }
            if (dataReader.IsDBNull(dataReader.GetOrdinal("TechnicalContactEmail")))
            {
                data.TechnicalContact.Email = StringType.UNSET;
            }
            else
            {
                data.TechnicalContact.Email = StringType.Parse(dataReader.GetString(dataReader.GetOrdinal("TechnicalContactEmail")));
            }

            return(data);
        }