当前位置: 首页>>代码示例>>C#>>正文


C# SqlDataReader.Int16NullableField方法代码示例

本文整理汇总了C#中System.Data.SqlClient.SqlDataReader.Int16NullableField方法的典型用法代码示例。如果您正苦于以下问题:C# SqlDataReader.Int16NullableField方法的具体用法?C# SqlDataReader.Int16NullableField怎么用?C# SqlDataReader.Int16NullableField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.SqlClient.SqlDataReader的用法示例。


在下文中一共展示了SqlDataReader.Int16NullableField方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MapEventTypes

        /// <summary>
        /// Maps the event types.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>Event type data filled</returns>
        private static async Task<EventType> MapEventTypes(SqlDataReader dataReader)
        {
            var eventType = new EventType();
            if (dataReader != null)
            {
                eventType.EventTypeId = dataReader.Int16NullableField(EventTypeId).ToString();
                eventType.Name = dataReader.StringField(Name);
                eventType.Description = dataReader.StringField(Description);
            }

            return await Task.FromResult(eventType);
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:17,代码来源:EventTypeDataMapper.cs

示例2: RetrieveCrewmemberPersonalDetail

        /// <summary>
        /// Maps the crew personal detail.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>The crew member</returns>
        private static async Task<CrewmemberCollection> RetrieveCrewmemberPersonalDetail(SqlDataReader dataReader)
        {
            var crewmembers = new CrewmemberCollection();

            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var crewmember = new Crewmember();
                    crewmember.CrewmemberId = dataReader.Int32Field(CrewMemberId).ToString();
                    crewmember.PersonalDetail = new PersonalDetail();
                    crewmember.PersonalDetail.Age = dataReader.Int16NullableField(Age);
                    crewmember.PersonalDetail.AnniversaryDate = dataReader.DateTimeNullableField(AnniversaryDate);
                    crewmember.PersonalDetail.BirthCountryId = dataReader.Int32NullableField(BirthCountryId).ToString();
                    crewmember.PersonalDetail.Birthdate = dataReader.DateTimeNullableField(BirthDate);
                    crewmember.PersonalDetail.CitizenshipCountryId = dataReader.Int32NullableField(CitizenshipCountryId).ToString();
                    crewmember.PersonalDetail.FirstName = dataReader.StringField(FirstName);
                    crewmember.PersonalDetail.Gender = dataReader.StringField(Gender);
                    crewmember.PersonalDetail.LastName = dataReader.StringField(LastName);
                    crewmember.PersonalDetail.MaritalStatus = dataReader.StringField(MaritalStatus);
                    crewmember.PersonalDetail.MiddleName = dataReader.StringField(MiddleName);
                    crewmember.PersonalDetail.Nickname = dataReader.StringField(NickName);
                    crewmember.PersonalDetail.Occupation = dataReader.StringField(Occupation);
                    crewmember.PersonalDetail.DocumentNumber = dataReader.StringField(DocumentNumber);
                    crewmember.PersonalDetail.Suffix = dataReader.StringField(Suffix);
                    crewmember.PersonalDetail.Title = dataReader.StringField(Title);
                    crewmember.PersonalDetail.PreferredName = dataReader.StringField(PreferredName);
                    crewmember.BoardingInfo.OnboardDate = dataReader.DateTimeNullableField(OnboardDate);
                    crewmember.BoardingInfo.AshoreDate = dataReader.DateTimeNullableField(AshoreDate);                    

                    crewmembers.Add(crewmember);
                }
            }

            return crewmembers;
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:41,代码来源:PersonDataMapper.cs

示例3: RetrieveGuestReservationDetail

        /// <summary>
        /// Maps the guest reservation detail.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>Guest collection</returns>
        private static async Task<GuestCollection> RetrieveGuestReservationDetail(SqlDataReader dataReader)
        {
            var guestCollection = new GuestCollection();
            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var guest = new Guest();

                    guest.GuestId = dataReader.Int32Field(GuestId).ToString();
                    guest.CruiseDetail = new GuestCruiseDetail();
                    guest.CruiseDetail.ReservationId = dataReader.Int32Field(ReservationId).ToString();
                    guest.CruiseDetail.ReservationNumber = dataReader.StringField(ReservationNumber);
                    guest.CruiseDetail.IsVip = dataReader.BooleanField(VIPFlag);
                    guest.CruiseDetail.IsPrimary = dataReader.BooleanField(IsPrimary);
                    guest.CruiseDetail.Stateroom = dataReader.StringField(Stateroom);
                    guest.CruiseDetail.EmbarkDate = dataReader.DateTimeField(EmbarkDate);
                    guest.CruiseDetail.DebarkDate = dataReader.DateTimeField(DebarkDate);
                    guest.CruiseDetail.ReservationStatusId = dataReader.ByteField(ReservationStatusId).ToString();
                    guest.CruiseDetail.VoyageId = dataReader.Int32Field(VoyageId).ToString();
                    var loyaltyLevelTypeId = dataReader.Int32NullableField(LoyaltyLevelTypeId);
                    guest.CruiseDetail.LoyaltyLevelTypeId = loyaltyLevelTypeId.HasValue ? loyaltyLevelTypeId.Value.ToString() : null;
                    var beaconId = dataReader.Int32NullableField(BeaconId);
                    guest.CruiseDetail.BeaconId = beaconId.HasValue ? beaconId.Value.ToString() : null;
                    ////guest.CruiseDetail.HasRecovery = dataReader.BooleanField(HasRecovery);
                    guest.CruiseDetail.HasTravelWith = dataReader.BooleanField(HasTravelWith);
                    guest.CruiseDetail.IsFolioAtRisk = dataReader.BooleanField(IsFolioAtRisk);
                    guest.CruiseDetail.CanDebarkAlone = dataReader.BooleanField(CanDebarkAlone);
                    guest.CruiseDetail.StateroomOccupancy = dataReader.ByteField(StateroomOccupancy).ToString();
                    guest.CruiseDetail.DiningDetail = dataReader.StringField(DiningDetail);
                    guest.CruiseDetail.IsCheckedIn = dataReader.BooleanField(IsCheckedIn);
                    guest.CruiseDetail.IsConciergeStatus = dataReader.BooleanField(IsConciergeStatus);
                    guest.CruiseDetail.IsBackToBack = dataReader.BooleanField(IsBackToBack);

                    var stateroomCategoryTypeId = dataReader.Int16NullableField(StateroomCategoryTypeID);
                    guest.CruiseDetail.StateroomCategoryTypeId = stateroomCategoryTypeId.HasValue ? stateroomCategoryTypeId.Value.ToString() : null;
                    guest.CruiseDetail.StateroomCategoryType = dataReader.StringField(Category);

                    guestCollection.Add(guest);
                }
            }

            return guestCollection;
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:49,代码来源:PersonDataMapper.cs

示例4: RetrieveVisitorPersonalDetail

        /// <summary>
        /// Maps the visitor personal detail.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>Visitor collection</returns>
        private static async Task<VisitorCollection> RetrieveVisitorPersonalDetail(SqlDataReader dataReader)
        {
            var visitors = new VisitorCollection();

            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var visitor = new Visitor();
                    visitor.VisitorId = dataReader.Int32Field(VisitorId).ToString();
                    visitor.PersonalDetail = new PersonalDetail();
                    visitor.VisitorInfo = new VisitorInfo();
                    visitor.PersonalDetail.Age = dataReader.Int16NullableField(Age);
                    visitor.PersonalDetail.AnniversaryDate = dataReader.DateTimeNullableField(AnniversaryDate);
                    visitor.PersonalDetail.BirthCountryId = dataReader.Int32NullableField(BirthCountryId).ToString();
                    visitor.PersonalDetail.Birthdate = dataReader.DateTimeNullableField(BirthDate);
                    visitor.PersonalDetail.CitizenshipCountryId = dataReader.Int32NullableField(CitizenshipCountryId).ToString();
                    visitor.PersonalDetail.FirstName = dataReader.StringField(FirstName);
                    visitor.PersonalDetail.Gender = dataReader.StringField(Gender);
                    visitor.PersonalDetail.LastName = dataReader.StringField(LastName);
                    visitor.PersonalDetail.MaritalStatus = dataReader.StringField(MaritalStatus);
                    visitor.PersonalDetail.MiddleName = dataReader.StringField(MiddleName);
                    visitor.PersonalDetail.Nickname = dataReader.StringField(NickName);
                    visitor.PersonalDetail.Occupation = dataReader.StringField(Occupation);
                    visitor.PersonalDetail.DocumentNumber = dataReader.StringField(DocumentNumber);
                    visitor.PersonalDetail.Suffix = dataReader.StringField(Suffix);
                    visitor.PersonalDetail.Title = dataReader.StringField(Title);
                    visitor.PersonalDetail.DepartmentName = dataReader.StringField(Department);
                    visitor.PersonalDetail.DepartmentPOC = dataReader.StringField(Contact);
                    visitor.VisitorInfo.CompanyName = dataReader.StringField(Company);
                    visitor.PersonalDetail.DocumentNumber = dataReader.StringField(DocumentNumber);
                    visitor.PersonalDetail.DocumentType = dataReader.StringField(DocumentType);
                    ////visitor.VisitorInfo.ContactNumber = dataReader.StringField(ContactPhoneNumber);
                    visitor.VisitorInfo.CompanyContactNumber = dataReader.StringField(ContactPhoneNumber);
                    visitor.PersonalDetail.DocumentTypeId = dataReader.Int16Field(DocumentTypeId).ToString();
                    visitors.Add(visitor);
                }
            }

            return visitors;
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:46,代码来源:PersonDataMapper.cs

示例5: MapHistory

 /// <summary>
 /// Maps the history.
 /// </summary>
 /// <param name="dataReader">The data reader.</param>
 /// <returns>gangway history Object.</returns>
 private static GangwayHistory MapHistory(SqlDataReader dataReader)
 {
     return new GangwayHistory
     {
         PersonId = dataReader.StringField(PersonID),
         PersonTypeId = dataReader.ByteNullableField(PersonTypeID).HasValue ? dataReader.ByteNullableField(PersonTypeID).Value.ToString(CultureInfo.CurrentCulture) : null,
         FirstName = dataReader.StringField(FirstName),
         LastName = dataReader.StringField(LastName),
         GangwayEventTypeId = dataReader.Int16NullableField(EventTypeId).HasValue ? dataReader.Int16NullableField(EventTypeId).Value.ToString(CultureInfo.CurrentCulture) : null,
         EventDateTime = dataReader.DateTimeNullableField(EventDate),
         EventDetails = !string.IsNullOrWhiteSpace(dataReader.StringField(EventDetail)) ? dataReader.StringField(EventDetail).DeserializeXml<EventDetail>() : null,
         GangwayLocation = dataReader.StringField(Location),
         MachineName = dataReader.StringField(MachineName),
         PortCode = dataReader.StringField(Port),
         UserName = dataReader.StringField(AddedBy)
     };
 }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:22,代码来源:GangwayHistoryMapper.cs


注:本文中的System.Data.SqlClient.SqlDataReader.Int16NullableField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。