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


C# SafeDataReader.GetInt32方法代码示例

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


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

示例1: ReadRequiredRuleConfigFields

        /// <summary>
        /// Reads required rule config fields.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        /// ProcessCommandSecurityConfigurations
        private static void ReadRequiredRuleConfigFields(ProcessEditDto process, SafeDataReader sr)
        {
            sr.NextResult();

            int? requiredConfigId = null;
            RequiredRuleConfigEditDto config = null;

            while (sr.Read())
            {
                var configFieldDto = new RequiredRuleConfigFieldEditDto
                {
                    Id = sr.GetInt32(0),
                    RequiredConfigId = sr.GetInt32(1),
                    Guid = sr.GetGuid(2),
                    FieldGuid = sr.GetGuid(3),
                    IsRequired = sr.GetBoolean(4)
                };

                if (configFieldDto.RequiredConfigId != requiredConfigId)
                {
                    config = process.RequiredRuleConfigs.First(rrc => rrc.Id == configFieldDto.RequiredConfigId);
                    requiredConfigId = configFieldDto.RequiredConfigId;
                }

                config.FieldList.Add(configFieldDto);
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:33,代码来源:ProcessDAL2.cs

示例2: FetchVoucherEdit

        private VoucherEditDto FetchVoucherEdit(SafeDataReader dr)
        {
            var voucherEdit = new VoucherEditDto();
            // Value properties
            voucherEdit.Id = dr.GetInt32("tran_id");
            voucherEdit.Amount = (Decimal?)dr.GetValue("tran_amount");
            voucherEdit.PersonId = !dr.IsDBNull("person_id") ? dr.GetString("person_id") : null;
            voucherEdit.NamePrefix = !dr.IsDBNull("name_prefix") ? dr.GetString("name_prefix") : null;
            voucherEdit.First = !dr.IsDBNull("first_name") ? dr.GetString("first_name") : null;
            voucherEdit.Middle = !dr.IsDBNull("middle_name") ? dr.GetString("middle_name") : null;
            voucherEdit.Last = !dr.IsDBNull("last_name") ? dr.GetString("last_name") : null;
            voucherEdit.Suffix = !dr.IsDBNull("name_suffix") ? dr.GetString("name_suffix") : null;
            voucherEdit.Title = !dr.IsDBNull("title") ? dr.GetString("title") : null;
            voucherEdit.Company = !dr.IsDBNull("company") ? dr.GetString("company") : null;
            voucherEdit.AddressLine1 = !dr.IsDBNull("address_1") ? dr.GetString("address_1") : null;
            voucherEdit.AddressLine2 = !dr.IsDBNull("address_2") ? dr.GetString("address_2") : null;
            voucherEdit.Municipality = !dr.IsDBNull("municipality") ? dr.GetString("municipality") : null;
            voucherEdit.Region = !dr.IsDBNull("region") ? dr.GetString("region") : null;
            voucherEdit.PostalCode = !dr.IsDBNull("postal_code") ? dr.GetString("postal_code") : null;
            voucherEdit.Country = !dr.IsDBNull("country") ? dr.GetString("country") : null;
            voucherEdit.PhoneNumber = !dr.IsDBNull("phone_number") ? dr.GetString("phone_number") : null;
            voucherEdit.EmailAddress = !dr.IsDBNull("email") ? dr.GetString("email") : null;
            voucherEdit.Updated = !dr.IsDBNull("updated") ? dr.GetSmartDate("updated", true) : null;

            return voucherEdit;
        }
开发者ID:FrankMedvedik,项目名称:coopcheck,代码行数:26,代码来源:BatchEditDal.designer.cs

示例3: Fetch

 public VoucherEditDto Fetch(int id)
 {
     var voucherEdit = new VoucherEditDto();
     using (var ctx = ConnectionManager<SqlConnection>.GetManager("CoopCheck"))
     {
         using (var cmd = new SqlCommand("dbo.dsa_GetVoucher", ctx.Connection))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@tran_id", id).DbType = DbType.Int32;
             var dr = new SafeDataReader(cmd.ExecuteReader());
             dr.Read();
             voucherEdit.Id = dr.GetInt32("tran_id");
             voucherEdit.Amount = (Decimal?)dr.GetValue("tran_amount");
             voucherEdit.PersonId = !dr.IsDBNull("person_id") ? dr.GetString("person_id") : null;
             voucherEdit.NamePrefix = !dr.IsDBNull("name_prefix") ? dr.GetString("name_prefix") : null;
             voucherEdit.First = !dr.IsDBNull("first_name") ? dr.GetString("first_name") : null;
             voucherEdit.Middle = !dr.IsDBNull("middle_name") ? dr.GetString("middle_name") : null;
             voucherEdit.Last = !dr.IsDBNull("last_name") ? dr.GetString("last_name") : null;
             voucherEdit.Suffix = !dr.IsDBNull("name_suffix") ? dr.GetString("name_suffix") : null;
             voucherEdit.Title = !dr.IsDBNull("title") ? dr.GetString("title") : null;
             voucherEdit.Company = !dr.IsDBNull("company") ? dr.GetString("company") : null;
             voucherEdit.AddressLine1 = !dr.IsDBNull("address_1") ? dr.GetString("address_1") : null;
             voucherEdit.AddressLine2 = !dr.IsDBNull("address_2") ? dr.GetString("address_2") : null;
             voucherEdit.Municipality = !dr.IsDBNull("municipality") ? dr.GetString("municipality") : null;
             voucherEdit.Region = !dr.IsDBNull("region") ? dr.GetString("region") : null;
             voucherEdit.PostalCode = !dr.IsDBNull("postal_code") ? dr.GetString("postal_code") : null;
             voucherEdit.Country = !dr.IsDBNull("country") ? dr.GetString("country") : null;
             voucherEdit.PhoneNumber = !dr.IsDBNull("phone_number") ? dr.GetString("phone_number") : null;
             voucherEdit.EmailAddress = !dr.IsDBNull("email") ? dr.GetString("email") : null;
             voucherEdit.Updated = !dr.IsDBNull("updated") ? dr.GetSmartDate("updated", true) : null;
         }
     }
     return voucherEdit;
 }
开发者ID:FrankMedvedik,项目名称:coopcheck,代码行数:34,代码来源:VoucherEditDal.cs

示例4: GetPatientChartFilterList

        public static ArrayList GetPatientChartFilterList()
        {
            ArrayList _filterList = new ArrayList();
            using (SqlConnection cn = new SqlConnection(Database.WaldenConnect))
            {
                cn.Open();
                using (SqlCommand cm = cn.CreateCommand())
                {
                    cm.CommandText = "select Name, Description,FilterID"
                        + " from PatientChartFilter"
                        + " where AccountID =" + Common.AccountID
                        + " and FilterId > 0"
                        + " order by Description";

                    using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
                    {
                        while (dr.Read())
                        {
                            _filterList.Add(dr.GetString(0) + "~"
                                + dr.GetString(1) + "~"
                                + dr.GetInt32(2));
                        }
                        return _filterList;
                    }
                }
            }
        }
开发者ID:connecticutortho,项目名称:ct-ortho-repositories4,代码行数:27,代码来源:ChartFilterList.cs

示例5: GetTemplates

 public static ArrayList GetTemplates(string _templateType)
 {
     ArrayList aTemplates = new ArrayList();
     using (SqlConnection cn = new SqlConnection(Database.WaldenConnect))
     {
         cn.Open();
         using (SqlCommand cm = cn.CreateCommand())
         {
             cm.CommandText = "select B.Name ,B.TemplateID from TemplateType A,Templates B"
             + " where A.Name = '" + _templateType + "'"
             + " and A.AccountID = " + Common.AccountID
             + " and B.AccountID = " + Common.AccountID
             + " and A.TemplateTypeID = B.TemplateTypeID"
             + " order by B.Name";
             Common.Log(cm.CommandText);
             using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
             {
                 while (dr.Read())
                 {
                     aTemplates.Add(dr.GetString(0) + "~"
                         + dr.GetInt32(1).ToString());
                       //  + dr.GetDateTime(1).ToShortDateString() + "~"
                       //  + dr.GetString(2) + "~"
                       //  + dr.GetString(3) + "~"
                       //  + dr.GetInt32(4).ToString());
                 }
                 return aTemplates;
             }
         }
     }
 }
开发者ID:connecticutortho,项目名称:ct-ortho-repositories4,代码行数:31,代码来源:TemplateLists.cs

示例6: Fetch

        private AccountListItemDto Fetch(SafeDataReader dr)
        {
            var accountListItem = new AccountListItemDto();
            accountListItem.Id = dr.GetInt32("account_id");
            accountListItem.Name = dr.GetString("account_name");

            return accountListItem;
        }
开发者ID:FrankMedvedik,项目名称:coopcheck,代码行数:8,代码来源:AccountListDal.Designer.cs

示例7: Fetch

        private OpenBatchListItemDto Fetch(SafeDataReader dr)
        {
            var openBatchListItem = new OpenBatchListItemDto();
            openBatchListItem.Num = dr.GetInt32("batch_num");
            openBatchListItem.Label = !dr.IsDBNull("batch_label") ? dr.GetString("batch_label") : null;

            return openBatchListItem;
        }
开发者ID:FrankMedvedik,项目名称:coopcheck,代码行数:8,代码来源:OpenBatchListDal.Designer.cs

示例8: FetchDashboard

        /// <summary>
        /// Retrieves dashboard DTO object for a given account id.
        /// </summary>
        /// <param name="accountId">The account id.</param>
        /// <returns>The <see cref="DashboardDto" />.</returns>
        public DashboardDto FetchDashboard(int accountId)
        {
            var result = new DashboardDto();
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.VeyronMeta, false))
            {
                var cn = ctx.Connection;
                if (cn.State != ConnectionState.Open)
                {
                    cn.Open();
                }

                const string CommandText = @"
    SELECT   [Id]
            , [SelectedPageIndex]
    FROM   [dbo].[Dashboards]
    WHERE  [AccountId] = @accountId
";

                if (cn.State != ConnectionState.Open)
                {
                    cn.Open();
                }

                using (var cmd = new SqlCommand(CommandText, cn))
                {
                    cmd.Parameters.AddWithValue("@accountId", accountId);

                    using (var reader = new SafeDataReader(cmd.ExecuteReader()))
                    {
                        if (reader.Read())
                        {
                            result.Id = reader.GetInt32(0);
                            result.SelectedPageIndex = reader.GetInt32(1);
                        }
                        else return null;
                    }
                }

                ReadDashboardPages(result);

                return result;
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:48,代码来源:DashboardDal.cs

示例9: ReadSearchDisplayFields

        /// <summary>
        /// Reads search display fields.
        /// </summary>
        /// <param name="process">The process.</param>
        /// <param name="sr">The reader.</param>
        private static void ReadSearchDisplayFields(ProcessEditDto process, SafeDataReader sr)
        {
            sr.NextResult();

            while (sr.Read())
            {
                process.Search.Add(
                    new ProcessSearchEditDto
                    {
                        Id = sr.GetInt32(0),
                        ProcessId = sr.GetInt32(1),
                        GuidId = sr.GetGuid(2),
                        FieldSystemName = sr.GetString(3),
                        Position = sr.GetInt32(4),
                        Width = sr.GetInt32(5),
                        ShowInList = sr.GetBoolean(6)
                    });
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:24,代码来源:ProcessDAL2.cs

示例10: FetchLocalizationList

        public IList<LocalizationDto> FetchLocalizationList()
        {
            var result = new List<LocalizationDto>();
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.VeyronMeta, false))
            {
                var connection = ctx.Connection;

                var commandText = string.Format(CultureInfo.InvariantCulture, 
                    @"
SELECT  loc.[Id],
        loc.[LocalName],
        loc.[EnglishName],
        loc.[CultureName],
        loc.[IconId],
        loc.[IsRightToLeft],
        loc.[IsDefault]
FROM    [dbo].[Localizations] loc
ORDER BY loc.EnglishName");
                using (var cmd = new SqlCommand(commandText, connection))
                using (var reader = new SafeDataReader(cmd.ExecuteReader()))
                    while (reader.Read())
                    {
                        var dto = new LocalizationDto
                        {
                            Id = reader.GetInt32(0),
                            LocalName = reader.GetString(1),
                            EnglishName = reader.GetString(2),
                            CultureName = reader.GetString(3),
                            IconId = reader.GetInt32(4),
                            IsRightToLeft = reader.GetBoolean(5),
                            IsDefault = reader.GetBoolean(6)
                        };

                        result.Add(dto);
                    }
            }

            return result;
        }
开发者ID:mparsin,项目名称:Elements,代码行数:39,代码来源:LocalizationDAL.cs

示例11: FetchEdcList

        public IEnumerable<EDCEditDto> FetchEdcList()
        {
            const string sql = @"
  SELECT [Id]
        ,[Name]
        ,[SystemName]
        ,[Documentation]       
        ,[GuidId]
  FROM [dbo].[ExternalDataConfiguration] edc 
";
            var result = new List<EDCEditDto>();

            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.VeyronMeta, false))
            {
                var cn = ctx.Connection;
                if (cn.State != ConnectionState.Open)
                {
                    cn.Open();
                }

                using (var cmd = new SqlCommand(sql, cn))
                {
                    using (var sr = new SafeDataReader(cmd.ExecuteReader()))
                    {
                        while (sr.Read())
                        {
                            var parameter = new EDCEditDto
                            {
                                Id = sr.GetInt32(0),
                                Name = sr.GetString(1),
                                SystemName = sr.GetString(2),
                                Documentation = sr.GetString(3),
                                Guid = sr.GetGuid(4)
                            };

                            result.Add(parameter);
                        }
                    }

                    foreach (var dto in result)
                    {
                        dto.ConnectionList = new List<EDCConnectionEditDto>();
                        dto.DataVariableList = new List<EDCDataVariablesEditDto>();
                        FetchEDCConnectionList(cn, dto);
                        FetchDataVariableList(cn, dto);
                    }
                }
            }

            return result;
        }
开发者ID:mparsin,项目名称:Elements,代码行数:51,代码来源:EDCDal.cs

示例12: FetchSystemParameters

        /// <summary>
        /// Fetch System Parameters
        /// </summary>
        /// <returns>IEnumerable{SystemParametersDto}.</returns>
        /// <exception cref="DataAccessException"></exception>
        public IEnumerable<SystemParametersDto> FetchSystemParameters()
        {
            const string Sql = @"
  SELECT [Id]
      ,[Name]
      ,[Documentation]
	  ,[Type]
	  ,[ProcessSystemName]  
	  ,[Expression]  
      ,[GuidId]
      ,[LastModifiedOn]
  FROM [dbo].[SystemParameters] sp
  WHERE  sp.IsRemoved = 0
";

            var result = new List<SystemParametersDto>();
            Database.GetDataReader(
                Sql,
                reader =>
                {
                    if (reader == null)
                    {
                        throw new DataAccessException(Resources.FailedToRetrieveSystemOptions);
                    }

                    using (var sr = new SafeDataReader(reader))
                    {
                        while (reader.Read())
                        {
                            var parameter = new SystemParametersDto
                                                {
                                                    ParameterId = sr.GetInt32(0),
                                                    Name = sr.GetString(1),
                                                    Documentation = sr.GetString(2),
                                                    ParameterType = !string.IsNullOrEmpty(reader.GetString(3))
                                                        ? (SystemParameterType)Enum.Parse(typeof(SystemParameterType), reader.GetString(3))
                                                        : SystemParameterType.Int,
                                                    PersonProcessSystemName = sr.GetString(4),
                                                    Expression = sr.GetString(5),
                                                    Guid = sr.GetGuid(6),
                                                    LastModifiedOn = sr.GetDateTime(7)
                                                };

                            result.Add(parameter);
                        }
                    }
                });

            return result;
        }
开发者ID:mparsin,项目名称:Elements,代码行数:55,代码来源:SystemParametersDAL.cs

示例13: GetAmazingChartSchedule

        public static ArrayList GetAmazingChartSchedule(string _beginDate, string _endDate)
        {
            ArrayList items = new ArrayList();
            using (SqlConnection cn = new SqlConnection(Database.AmazingChartsConnection))
            {
                cn.Open();
                using (SqlCommand cm = cn.CreateCommand())
                {
                    cm.CommandText = "SELECT VisitID,Date,PatientID,Name,Phone,VisitType,"
                        + "Comments,Booker,DateBooked,ProviderID,Duration,XLinkProviderID,"
                        + "VisitIdExternal,DateLastTouched,LastTouchedBy,DateRowAdded"
                        + " FROM Scheduling"
                        + " where Date between '" + _beginDate + "'" + " and '" + _endDate + "'"
                        + " order by Date;";

                    using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
                    {
                        while (dr.Read())
                        {

                            items.Add(dr.GetInt32(0).ToString() + "~"
                                + dr.GetDateTime(1).ToShortDateString() + "~"
                                + dr.GetDateTime(1).ToShortTimeString() + "~"
                                + dr.GetInt32(2).ToString() + "~"
                                + dr.GetString(3) + "~"
                                + dr.GetString(4) + "~"
                                + dr.GetString(5) + "~"
                                + dr.GetString(6) + "~"
                                + dr.GetString(7) + "~"
                                + dr.GetDateTime(8).ToShortDateString() + "~"
                                + dr.GetInt32(9).ToString() + "~");
                        }
                        return items;
                    }
                }
            }
        }
开发者ID:connecticutortho,项目名称:ct-ortho-repositories4,代码行数:37,代码来源:SSIMEDCalls.cs

示例14: ReadPalette

        /// <summary>
        /// Reads the palette.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns>PaletteDTO.</returns>
        private static PaletteDTO ReadPalette(SafeDataReader reader)
        {
            return new PaletteDTO
                       {
                           Id = reader.GetInt32(0),
                           Name = reader.GetString(1),

                           MainBackColor = (uint)reader.GetInt64(2),
                           MainFrontColor = (uint)reader.GetInt64(3),
                           StrongBackColor = (uint)reader.GetInt64(4),
                           StrongFrontColor = (uint)reader.GetInt64(5),
                           CalmBackColor = (uint)reader.GetInt64(6),
                           CalmFrontColor = (uint)reader.GetInt64(7),
                       };
        }
开发者ID:mparsin,项目名称:Elements,代码行数:20,代码来源:PaletteDal.cs

示例15: Fetch

 private AccountDto Fetch(IDataReader data)
 {
     var account = new AccountDto();
     using (var dr = new SafeDataReader(data))
     {
         if (dr.Read())
         {
             account.Id = dr.GetInt32("account_id");
             account.Name = dr.GetString("account_name");
             account.Description = !dr.IsDBNull("account_dscr") ? dr.GetString("account_dscr") : null;
             account.Number = !dr.IsDBNull("account_number") ? dr.GetString("account_number") : null;
             account.Balance = (Decimal?)dr.GetValue("balance");
             account.LastReconciliationDate = !dr.IsDBNull("last_rec_date") ? dr.GetSmartDate("last_rec_date", true) : null;
             account.LastReconciliationBalance = (Decimal?)dr.GetValue("last_rec_balance");
         }
     }
     return account;
 }
开发者ID:FrankMedvedik,项目名称:coopcheck,代码行数:18,代码来源:AccountDal.Designer.cs


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