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


C# DataRow.GetDate方法代码示例

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


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

示例1: ParseUserLoginInfo

        /// <summary>
        /// Converts a user data row into a app user entity
        /// </summary>
        /// <param name="dr"></param>
        /// <returns></returns>
        protected virtual User ParseUserLoginInfo(DataRow dr)
        {
            var user = new User();
            user.Id = dr.Get<int>("UserId");
            user.UserName = dr.GetString("UserName");
            user.Role = dr.Get<UserRole>("UserGroupId");
            user.Guid = dr.Get<Guid>("UserGuid");
            user.ExternalProfileUrl = dr.GetString("UserExternalProfileUrl");
            user.ProviderLastCall = dr.GetDate("UserProviderLastCall");
            user.Email = dr.GetString("UserEmail");
            decimal offSet = dr.Get<decimal>("UserTimeZone");
            user.TimeZone = new TimeSpan((long)(offSet * (decimal)TimeSpan.TicksPerHour));
            if (dr.Table.Columns.Contains("WarningStart"))
            {
                user.Warned = (!dr.IsNull("WarningStart")) && dr.GetNullableStruct<bool>("WarningRead") != true;
                user.Suspended = (!dr.IsNull("SuspendedStart")) && (dr.IsNull("SuspendedEnd") || dr.GetNullableStruct<DateTime>("SuspendedEnd") >= DateTime.UtcNow);
                user.Banned = !dr.IsNull("BannedStart");
                user.SuspendedEnd = dr.GetNullableStruct<DateTime>("SuspendedEnd");
            }

            //se obtiene el perfil desde construnario
            UserProfileAcces profileaccess = new UserProfileAcces(MysqlconnectionString);
            user.Construnario_Profile = profileaccess.Get_UserProfilebyUserName(user.UserName );

            return user;
        }
开发者ID:ramiglez30,项目名称:Forum-Construnario,代码行数:31,代码来源:UsersDataAccess.cs

示例2: ParseUserInfo

        protected virtual User ParseUserInfo(DataRow dr)
        {
            User user = new User();
            user.Id = dr.Get<int>("UserId");
            user.UserName = dr.GetString("UserName");
            user.Role = dr.Get<UserRole>("UserGroupId");
            user.RoleName = dr.GetString("UserGroupName");
            user.RegistrationDate = dr.GetDate("UserRegistrationDate");

            decimal offSet = dr.Get<decimal>("UserTimeZone");
            user.TimeZone = new TimeSpan((long)(offSet * (decimal)TimeSpan.TicksPerHour));

            //se obtiene el perfil desde construnario
            UserProfileAcces profileaccess = new UserProfileAcces(MysqlconnectionString);
            user.Construnario_Profile = profileaccess.Get_UserProfilebyUserName(user.UserName );

            return user;
        }
开发者ID:ramiglez30,项目名称:Forum-Construnario,代码行数:18,代码来源:UsersDataAccess.cs

示例3: GetProduct

 private static Product GetProduct(DataRow dr)
 {
     return new Product
     {
         Sku = dr.GetString("SKU"),
         GatewayId = dr.GetGuid("GatewayId"),
         TypeId = dr.GetGuid("Type"),
         TrialPeriodDays = dr.GetInt("TrialPeriodDays"),
         InitialPrice = dr.GetDouble("InitialPrice"),
         RecurringPrice = dr.GetDouble("RecurringPrice"),
         SubscriptionDuration = dr.GetNullableInt("SubscriptionDuration"),
         AvailableDuration = dr.GetNullableInt("AvailableDuration"),
         LastUpdatedBy = dr.GetString("LastUpdatedBy"),
         LastUpdatedOn = dr.GetDate("LastUpdatedOn"),
         CreatedOn = dr.GetDate("CreatedOn"),
         CreatedBy = dr.GetString("CreatedBy"),
         RefId = dr.GetInt("RefId"),
         IsCurrent = dr.GetBoolean("Current", false),
         Active = dr.GetBoolean("Active", false),
     };
 }
开发者ID:IdeaFortune,项目名称:Monaco,代码行数:21,代码来源:ProductController.cs

示例4: ParseBasicTopicDataRow

        public virtual Topic ParseBasicTopicDataRow(DataRow dr, bool parseAccessRights)
        {
            Topic t = new Topic();
            t.Id = dr.Get<int>("TopicId");
            t.Date = dr.GetDate("TopicCreationDate");
            t.Title = dr.GetString("TopicTitle");
            t.ShortName = dr.GetString("TopicShortName");
            t.Description = dr.GetString("TopicDescription");
            t.Replies = dr.Get<int>("TopicReplies");
            t.Views = dr.Get<int>("TopicViews");
            t.IsClosed = dr.Get<bool>("TopicIsClose");
            t.IsSticky = dr.GetNullable<int?>("TopicOrder") >= 0;
            if (parseAccessRights)
            {
                t.ReadAccessRole = dr.GetNullableStruct<UserRole>("ReadAccessGroupId");
                t.PostAccessRole = dr.Get<UserRole>("PostAccessGroupId");
            }

            return t;
        }
开发者ID:jorgebay,项目名称:nearforums,代码行数:20,代码来源:TopicsDataAccess.cs

示例5: ParseBasicMessageRow

        protected virtual Message ParseBasicMessageRow(DataRow dr)
        {
            var m = new Message();
            m.Id = dr.Get<int>("MessageId");
            m.Body = dr.GetString("MessageBody");
            m.Date = dr.GetDate("MessageCreationDate");
            m.User = (new UsersDataAccess()).Get(dr.Get<int>("UserId"));
            m.User.Signature = dr.GetNullableString("UserSignature");
            m.User.Role = dr.Get<UserRole>("UserGroupId");
            m.User.RoleName = dr.GetString("UserGroupName");
            m.Topic = new Topic(dr.Get<int>("TopicId"));
            m.Active = dr.Get<bool>("Active");

            return m;
        }
开发者ID:ramiglez30,项目名称:Forum-Construnario,代码行数:15,代码来源:MessagesDataAccess.cs

示例6: ParseUserInfo

        protected virtual User ParseUserInfo(DataRow dr)
        {
            User user = new User();
            user.Id = dr.Get<int>("UserId");
            user.UserName = dr.GetString("UserName");
            user.Role = dr.Get<UserRole>("UserGroupId");
            user.RoleName = dr.GetString("UserGroupName");
            user.RegistrationDate = dr.GetDate("UserRegistrationDate");

            decimal offSet = dr.Get<decimal>("UserTimeZone");
            user.TimeZone = new TimeSpan((long)(offSet * (decimal)TimeSpan.TicksPerHour));

            return user;
        }
开发者ID:jorgebay,项目名称:nearforums,代码行数:14,代码来源:UsersDataAccess.cs


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