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


C# IDataReader.GetNullableInt方法代码示例

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


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

示例1: Mapper

        internal AnnonceDTO Mapper(IDataReader rd, AnnonceDTO annonce)
        {
            annonce.Texte = rd.GetString("TEXTE");
            annonce.Titre = rd.GetString("TITRE");
            if (rd.GetNullableInt("BIENID") != null) {
                BienDAO bien = new BienDAO();
                annonce.Bien = bien.Charger(rd.GetInt("BIENID"));
            }
            annonce.Prix = rd.GetFloat("PRIX");
            annonce.IdAnnonce = rd.GetInt("ID");

            return annonce;
        }
开发者ID:JeremyJacquemont,项目名称:SchoolProjects,代码行数:13,代码来源:AnnonceDAO.cs

示例2: ReadIntegrationServiceWebMethodCallResultFields

        /// <summary>
        /// Reads the integration service web method call result fields.
        /// </summary>
        /// <param name="settingsDto">
        /// The settings DTO.
        /// </param>
        /// <param name="reader">
        /// The reader.
        /// </param>
        private static void ReadIntegrationServiceWebMethodCallResultFields(
            IntegrationServiceWebMethodCallSettingsDto settingsDto,
            IDataReader reader)
        {
            reader.NextResult();

            var resultFields = new List<IntegrationServiceWebMethodCallResultFieldDto>();
            var resultFieldsMap = new Dictionary<int, IntegrationServiceWebMethodCallResultFieldDto>();

            while (reader.Read())
            {
                var dto = new IntegrationServiceWebMethodCallResultFieldDto
                          {
                              Id = reader.GetInt32(0),
                              ParentId = reader.GetNullableInt(1),
                              Name = reader.GetString(2),
                              DeclaringTypeName = reader.GetString(3)
                          };

                resultFields.Add(dto);
                resultFieldsMap[dto.Id] = dto;
            }

            foreach (var field in resultFields)
            {
                if (!field.ParentId.HasValue)
                    settingsDto.ResultFields.Add(field);
                else
                    resultFieldsMap[field.ParentId.Value].Fields.Add(field);
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:40,代码来源:ProcessDAL.IntegrationServices.cs

示例3: Mapper

        internal AgendaDTO Mapper(IDataReader rd, AgendaDTO agenda)
        {
            agenda.Date = rd.GetDateTime("DATEENTREE");
            agenda.Description = rd.GetString("DESCRIPTION");
            agenda.Titre = rd.GetString("TITRE");
            if (rd.GetNullableInt("PROSPECTPERSONNEID") != null) {
                ProspectDAO prospect = new ProspectDAO();
                agenda.Prospect = prospect.Charger(rd.GetInt("PROSPECTPERSONNEID"));
            }
            if (rd.GetNullableInt("AGENTPERSONNEID") != null) {
                AgentDAO agent = new AgentDAO();
                agenda.Agent = agent.Charger(rd.GetInt("AGENTPERSONNEID"));
            }
            if (rd.GetNullableInt("ANNONCEID") != null) {
                AnnonceDAO annonce = new AnnonceDAO();
                agenda.Annonce = annonce.Charger(rd.GetInt("ANNONCEID"));
            }
            agenda.IdAgenda = rd.GetInt("ID");

            return agenda;
        }
开发者ID:JeremyJacquemont,项目名称:SchoolProjects,代码行数:21,代码来源:AgendaDAO.cs

示例4: ReadIntegrationServiceWebMethodCallParameters

        /// <summary>
        /// Reads the integration service web method call parameters.
        /// </summary>
        /// <param name="settingsDto">The settings dto.</param>
        /// <param name="reader">The reader.</param>
        private static void ReadIntegrationServiceWebMethodCallParameters(IntegrationServiceWebMethodCallSettingsDto settingsDto, IDataReader reader)
        {
            reader.NextResult();

            var parameters = new List<IntegrationServiceWebMethodCallParameterDto>();
            var parametersMap = new Dictionary<int, IntegrationServiceWebMethodCallParameterDto>();

            while (reader.Read())
            {
                var dto = new IntegrationServiceWebMethodCallParameterDto
                              {
                                  Id = reader.GetInt32(0),
                                  ParentId = reader.GetNullableInt(1),
                                  Guid = reader.GetGuid(2),
                                  Name = reader.GetString(3),
                                  TypeCode =
                                      (WebServiceTypeCode)
                                      Enum.Parse(typeof(WebServiceTypeCode), reader.GetString(4), true),
                                  TypeName = reader.GetString(5),
                                  TypeDisplayName = reader.GetString(6),
                                  IsNull = reader.GetBoolean(7),
                                  IsArray = reader.GetBoolean(8),
                                  ArrayItemCount = reader.GetNullableInt(9),
                                  IsEnum = reader.GetBoolean(10),
                                  IsSoapHeader = reader.GetBoolean(11)
                              };

                parameters.Add(dto);
                parametersMap[dto.Id] = dto;
            }

            foreach (var parameter in parameters)
            {
                if (!parameter.ParentId.HasValue)
                    settingsDto.MethodParameters.Add(parameter);
                else
                    parametersMap[parameter.ParentId.Value].Subfields.Add(parameter);
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:44,代码来源:ProcessDAL.IntegrationServices.cs


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