本文整理汇总了C#中System.Data.DataRow.Get方法的典型用法代码示例。如果您正苦于以下问题:C# DataRow.Get方法的具体用法?C# DataRow.Get怎么用?C# DataRow.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.DataRow
的用法示例。
在下文中一共展示了DataRow.Get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseBasicPageContentRow
protected virtual ForumCategory ParseBasicPageContentRow(DataRow dr)
{
var category = new ForumCategory()
{
Id = dr.Get<int>("CategoryId"),
Name = dr.GetString("CategoryName"),
Order = dr.Get<int>("CategoryOrder")
};
return category;
}
示例2: GetActionInfo
private static ActionInfo GetActionInfo(DataRow row)
{
return new ActionInfo
{
Code = row.Get<string>("Code"),
Name = row.Get<string>("Name"),
Position = row.Get<string>("Position"),
Description = row.Get<string>("Description"),
Sequence = row.Get<int>("Sequence"),
IsVisible = true
};
}
示例3: Build_UserProfile
public UserProfile Build_UserProfile(DataRow dr)
{
UserProfile user = new UserProfile();
user.UserId = Convert.ToInt32(dr.Get<uint>("userId"));
user.Nombre = dr.GetString("nombre");
user.Empresa = dr.GetString("empresa");
user.Website = dr.GetString("website1");
return user;
}
示例4: 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;
}
示例5: 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;
}
示例6: ParseTemplateDataRow
private Template ParseTemplateDataRow(DataRow dr)
{
Template t = new Template();
t.Id = dr.Get<int>("TemplateId");
t.Key = dr.GetString("TemplateKey");
t.Description = dr.GetString("TemplateDescription");
return t;
}
示例7: ParseForumDataRow
protected virtual Forum ParseForumDataRow(DataRow dr)
{
Forum f = new Forum();
f.Name = dr.GetString("ForumName");
f.Description = dr.GetString("ForumDescription");
f.ShortName = dr.GetString("ForumShortName");
f.Id = dr.Get<int>("ForumId");
f.TopicCount = dr.Get<int>("ForumTopicCount");
f.MessageCount = dr.Get<int>("ForumMessageCount");
return f;
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11: GetRoleInfo
private static RoleInfo GetRoleInfo(DataRow row, bool initMenus)
{
var role = new RoleInfo
{
Id = row.Get<string>("Id"),
Name = row.Get<string>("Name"),
Description = row.Get<string>("Description"),
Menus = row.Get<string>("Menus")
};
if (initMenus)
{
var command = DbHelper.Default.CreateCommand();
command.Text = "select MenuId from T_RoleMenus where RoleId=?RoleId";
command.Parameters.Add("RoleId", role.Id);
var menus = command.ToList(r => { return r.Get<string>("MenuId"); });
if (string.IsNullOrEmpty(role.Menus))
{
role.Menus = string.Join(",", menus.ToArray());
}
else
{
role.Menus = role.Menus + "," + string.Join(",", menus.ToArray());
}
}
return role;
}