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


C# SqlDataReader.ByteField方法代码示例

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


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

示例1: MapVisitors

        /// <summary>
        /// Maps the visitors.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>The visitor collection</returns>
        private static async Task<VisitorCollection> MapVisitors(SqlDataReader dataReader)
        {
            var visitors = new VisitorCollection();
            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var visitor = new Visitor
                    {
                        HasAlert = dataReader.BooleanNullableField(HasAlert).HasValue ? dataReader.BooleanNullableField(HasAlert).Value : false,
                        HasMessage = dataReader.BooleanNullableField(HasMessage).HasValue ? dataReader.BooleanNullableField(HasMessage).Value : false,
                        LastDateTime = dataReader.DateTimeNullableField(LastDateTime),
                        LastEvent = dataReader.StringField(LastEvent),
                        SecurityPhotoAddress = dataReader.StringField(SecurityPhotoAddress),
                        VisitorId = dataReader.Int32Field(VisitorId).ToString(),
                        VisitorTypeId = dataReader.ByteField(VisitorTypeId).ToString(),
                        VisitorType = dataReader.StringField(VisitorType),
                        VisitPurpose = dataReader.StringField(VisitPurpose)
                    };

                    byte[] bytes = await visitor.SecurityPhotoAddress.ImageAddressToByteArray();
                    visitor.Photo = bytes.ToBitmapSource();
                    visitor.AssignPhotoByteArray(new Collection<byte>(bytes));
                    visitors.Add(visitor);
                }
            }

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

示例2: MapPersonMessage

 /// <summary>
 /// Maps the person message.
 /// </summary>
 /// <param name="dataReader">The data reader.</param>
 /// <returns>filled person message.</returns>
 private static PersonMessage MapPersonMessage(SqlDataReader dataReader)
 {
     return new PersonMessage
     {
         AlertId = dataReader.Int32Field(AlertId).ToString(CultureInfo.CurrentCulture),
         StatusId = dataReader.ByteField(StatusID).ToString(CultureInfo.CurrentCulture),
         AddedBy = dataReader.StringField(AddedBy),
         IsSoundEnable = dataReader.BooleanField(IsSoundEnable),
         AddedDateTime = dataReader.DateTimeNullableField(AddedDateTime)
     };
 }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:16,代码来源:AlertsAndMessageMapper.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: MapCrew

        /// <summary>
        /// Maps the crew.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>Crew member collection</returns>
        private static async Task<CrewmemberCollection> MapCrew(SqlDataReader dataReader)
        {
            var crewmemberCollection = new CrewmemberCollection();
            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var crew = new Crewmember();

                    crew.CrewmemberId = dataReader.Int32Field(CrewMemberId).ToString();
                    crew.CrewmemberTypeId = dataReader.ByteField(CrewMemberTypeId).ToString();
                    crew.EmployeeNo = dataReader.StringField(EmployeeNo);
                    var hasAlert = dataReader.BooleanNullableField(HasAlert);
                    var hasMessage = dataReader.BooleanNullableField(HasMessage);
                    crew.HasAlert = hasAlert.HasValue ? hasAlert.Value : false;
                    crew.HasMessage = hasMessage.HasValue ? hasMessage.Value : false;
                    crew.Position = dataReader.StringField(Position);
                    crew.LastDateTime = dataReader.DateTimeNullableField(LastDateTime);
                    crew.LastEvent = dataReader.StringField(LastEvent);
                    crew.SafetyNumber = dataReader.StringField(SafetyNumber);
                    crew.SecurityPhotoAddress = dataReader.StringField(SecurityPhotoAddress);
                    crew.Stateroom = dataReader.StringField(Stateroom);
                    crew.StateroomOccupancy = dataReader.ByteField(StateroomOccupancy).ToString();
                    crew.Department = dataReader.StringField(Department);
                    crew.PortAssignedDate = dataReader.DateTimeNullableField(PortAssignedDate);

                    byte[] bytes = await crew.SecurityPhotoAddress.ImageAddressToByteArray();
                    crew.Photo = bytes.ToBitmapSource();
                    crew.AssignPhotoByteArray(new Collection<byte>(bytes));
                    crewmemberCollection.Add(crew);
                }
            }

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

示例5: MapVoyageItinerary

 /// <summary>
 /// Maps the voyage itinerary.
 /// </summary>
 /// <param name="dataReader">The data reader.</param>
 /// <returns>Voyage Itinerary</returns>
 private static Itinerary MapVoyageItinerary(SqlDataReader dataReader)
 {
     return new Itinerary
     {
         VoyageItineraryId = dataReader.Int32Field(VoyageItineraryId).ToString(CultureInfo.CurrentCulture),
         PortId = dataReader.Int32Field(PortId).ToString(CultureInfo.CurrentCulture),
         ArrivalTime = dataReader.DateTimeNullableField(ArrivalTime),
         GangwayClosingTime = dataReader.DateTimeNullableField(GangwayClosingTime),
         GangwayOpeningTime = dataReader.DateTimeNullableField(GangwayOpeningTime),
         DepartureTime = dataReader.DateTimeNullableField(DepartureTime),
         Day = dataReader.ByteField(Day),
         IsSeaDay = dataReader.BooleanField(IsSeaDay)
     };
 }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:19,代码来源:ReferenceDataMapper.cs

示例6: MapVoyages

        /// <summary>
        /// Maps the voyages.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>The Collection of voyages</returns>
        private static async Task<ICollection<Voyage>> MapVoyages(SqlDataReader dataReader)
        {
            var voyages = new Collection<Voyage>();
            IDictionary<string, ICollection<Itinerary>> itineraries = new Dictionary<string, ICollection<Itinerary>>();
            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var voyage = new Voyage
                    {
                        VoyageId = dataReader.Int32Field(VoyageId).ToString(),
                        ShipId = dataReader.ByteField(ShipId).ToString(),
                        Number = dataReader.StringField(Number),
                        Name = dataReader.StringField(Name),
                        EmbarkDate = dataReader.DateTimeField(EmbarkDate),
                        DebarkDate = dataReader.DateTimeField(DebarkDate),
                        EmbarkPortId = dataReader.Int32Field(EmbarkPortId).ToString(),
                        DebarkPortId = dataReader.Int32Field(DebarkPortId).ToString(),
                        Nights = dataReader.ByteField(Nights),
                        DestinationId = dataReader.StringField(DestinationName),
                        IsActive = dataReader.BooleanField(IsActive),
                        MediaItemAddress = dataReader.StringField(MediaItemAddress)
                    };

                    byte[] bytes = await voyage.MediaItemAddress.ImageAddressToByteArray();
                    voyage.ItineraryGraphImage = bytes.ToBitmapSource();
                    voyages.Add(voyage);
                }
            }

            return voyages;
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:37,代码来源:ReferenceDataMapper.cs

示例7: MapGangwayLocations

        /// <summary>
        /// Maps the gangway locations.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>The collection of gangway location</returns>
        private static async Task<ICollection<GangwayLocation>> MapGangwayLocations(SqlDataReader dataReader)
        {
            var gangwayLocations = new Collection<GangwayLocation>();
            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var gangwayLocation = new GangwayLocation
                    {
                        LocationId = dataReader.Int32Field(LocationId).ToString(),
                        LocationTypeId = dataReader.ByteField(LocationTypeId).ToString(),
                        Name = dataReader.StringField(Name)
                    };

                    gangwayLocations.Add(gangwayLocation);
                }
            }

            return gangwayLocations.OrderBy(a => a.Name).ToList();
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:25,代码来源:ReferenceDataMapper.cs

示例8: MapShips

        /// <summary>
        /// Maps the ships.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>Ship data filled.</returns>
        private static async Task<Ship> MapShips(SqlDataReader dataReader)
        {
            var ship = new Ship();
            if (dataReader != null)
            {
                ship.BrandId = dataReader.ByteField(BrandId).ToString();
                ship.Code = dataReader.StringField(Code);
                ship.MediaItemAddress = dataReader.StringField(MediaItemAddress);
                ship.Name = dataReader.StringField(Name);
                ship.ShipId = dataReader.Int16Field(ShipId).ToString();

                byte[] bytes = await ship.MediaItemAddress.ImageAddressToByteArray();
                ship.ShipImage = bytes.ToBitmapSource();
            }

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

示例9: MapBrandPorts

        /// <summary>
        /// Maps the brand ports.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>brand and Port dictionary.</returns>
        private static async Task<IDictionary<int, Collection<int>>> MapBrandPorts(SqlDataReader dataReader)
        {
            var dictionary = new Dictionary<int, Collection<int>>();
            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var brandId = dataReader.ByteField(BrandId);
                    var portId = dataReader.Int32Field(PortId);

                    if (!dictionary.ContainsKey(brandId))
                    {
                        var strTest = new Collection<int>();
                        if (portId != default(int))
                        {
                            strTest.Add(portId);
                        }

                        dictionary.Add(brandId, strTest);
                    }
                    else
                    {
                        var val = dictionary[brandId];
                        if (portId != default(int))
                        {
                            val.Add(portId);
                        }
                    }
                }
            }

            return dictionary;
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:38,代码来源:ReferenceDataMapper.cs


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