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


C# SqlDataReader.Int16Field方法代码示例

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


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

示例1: MapShipTimeData

        /// <summary>
        /// Maps the ship time data.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>Gets the ship time</returns>
        internal static async Task<ShipTime> MapShipTimeData(SqlDataReader dataReader)
        {
            var shipTime = new ShipTime();
            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    shipTime.ShipId = dataReader.Int16Field(ShipId).ToString();
                    shipTime.UtcOffset = dataReader.Int16Field(UtcOffset);
                }
            }

            return shipTime;
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:19,代码来源:ShipTimeDataMapper.cs

示例2: 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

示例3: RetrieveGuestPersonalDetail

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

                    guest.GuestId = dataReader.Int32Field(GuestId).ToString();
                    guest.PersonalDetail = new PersonalDetail();
                    guest.PersonalDetail.Title = dataReader.StringField(Title);
                    guest.PersonalDetail.FirstName = dataReader.StringField(FirstName);
                    guest.PersonalDetail.MiddleName = dataReader.StringField(MiddleName);
                    guest.PersonalDetail.LastName = dataReader.StringField(LastName);
                    guest.PersonalDetail.Nickname = dataReader.StringField(NickName);
                    guest.PersonalDetail.PreferredName = dataReader.StringField(PreferredName);
                    guest.PersonalDetail.Suffix = dataReader.StringField(Suffix);
                    guest.PersonalDetail.Birthdate = dataReader.DateTimeNullableField(BirthDate);
                    guest.PersonalDetail.BirthCountryId = dataReader.Int32NullableField(BirthCountryId).HasValue ? dataReader.Int32NullableField("BirthCountryID").Value.ToString() : null;
                    guest.PersonalDetail.CitizenshipCountryId = dataReader.Int32NullableField(CitizenshipCountryId).HasValue ? dataReader.Int32NullableField("BirthCountryID").Value.ToString() : null;
                    guest.PersonalDetail.Gender = dataReader.StringField(Gender);
                    guest.PersonalDetail.MaritalStatus = dataReader.StringField(MaritalStatus);
                    guest.PersonalDetail.Occupation = dataReader.StringField(Occupation);
                    guest.PersonalDetail.AnniversaryDate = dataReader.DateTimeNullableField(AnniversaryDate);
                    guest.PersonalDetail.DocumentNumber = dataReader.StringField(DocumentNumber);
                    guest.PersonalDetail.Age = dataReader.Int16Field(Age);
                    guest.PersonalDetail.SourceId = dataReader.StringField(SourceId);

                    guestCollection.Add(guest);
                }
            }

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

示例4: MapStateroomCategories

        /// <summary>
        /// Maps the stateroom categories.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>The collection of stateroom category</returns>
        private static async Task<StateroomCategoryCollection> MapStateroomCategories(SqlDataReader dataReader)
        {
            var stateroomCategories = new StateroomCategoryCollection();
            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var stateroomCategory = new StateroomCategory
                    {
                        StateroomCategoryTypeId = dataReader.Int16Field(StateroomCategoryTypeId).ToString(),
                        StateroomCategoryType = dataReader.StringField(StateroomCategoryType),
                        MediaItemAddress = dataReader.StringField(MediaItemAddress),
                        Category = dataReader.StringField(Category)
                    };

                    byte[] bytes = await stateroomCategory.MediaItemAddress.ImageAddressToByteArray();
                    stateroomCategory.StateroomIcon = bytes.ToBitmapSource();
                    stateroomCategories.Add(stateroomCategory);
                }
            }

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

示例5: 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

示例6: MapDocumentTypes

        /// <summary>
        /// Maps the document types.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>Document types</returns>
        private static async Task<DocumentTypeCollection> MapDocumentTypes(SqlDataReader dataReader)
        {
            var documentTypeCollection = new DocumentTypeCollection();
            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var documentType = new DocumentType
                    {
                        DocumentTypeId = dataReader.Int16Field(DocumentTypeId).ToString(),
                        Code = dataReader.StringField(Code),
                        Name = dataReader.StringField(Name),
                        CountryId = dataReader.Int32NullableField(CountryId).HasValue ? dataReader.Int32NullableField(CountryId).Value.ToString() : null
                    };

                    documentTypeCollection.Add(documentType);
                }
            }

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

示例7: MapLoyaltyLevelTypes

        /// <summary>
        /// Maps the loyalty level types.
        /// </summary>
        /// <param name="dataReader">The data reader.</param>
        /// <returns>Loyalty level types</returns>
        private static async Task<LoyaltyLevelTypeCollection> MapLoyaltyLevelTypes(SqlDataReader dataReader)
        {
            var loyaltyLevelTypeCollection = new LoyaltyLevelTypeCollection();
            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var loyaltyLevelType = new LoyaltyLevelType
                    {
                        LoyaltyLevelTypeId = dataReader.Int32Field(LoyaltyLevelTypeId).ToString(),
                        NoOfCruiseNights = dataReader.Int32Field(NoOfCruiseNights),
                        Name = dataReader.StringField(Name),
                        LogoImageAddress = dataReader.StringField(LogoImageAddress),
                        BrandId = dataReader.Int16Field(BrandId).ToString()
                    };

                    byte[] bytes = await loyaltyLevelType.LogoImageAddress.ImageAddressToByteArray();
                    loyaltyLevelType.LoyaltyIcon = bytes.ToBitmapSource();
                    loyaltyLevelTypeCollection.Add(loyaltyLevelType);
                }
            }

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

示例8: MapBrands

        /// <summary>
        /// Function to map Brands.
        /// </summary>
        /// <param name="dataReader">Instance of SqlDataReader</param>
        /// <returns>Brand Collection</returns>
        private static async Task<BrandCollection> MapBrands(SqlDataReader dataReader)
        {
            var brandCollection = new BrandCollection();
            if (dataReader != null)
            {
                while (await dataReader.ReadAsync())
                {
                    var brand = new Brand
                    {
                        BrandId = dataReader.Int16Field(BrandId).ToString(),
                        Name = dataReader.StringField(Name),
                        MediaItemAddress = dataReader.StringField(MediaItemAddress)
                    };

                    byte[] bytes = await brand.MediaItemAddress.ImageAddressToByteArray();
                    brand.BrandIcon = bytes.ToBitmapSource();
                    brandCollection.Add(brand);
                }
            }

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


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