internal void LoadUserData(vw_carrot_UserData c) { this.UserId = Guid.Empty; this.Email = String.Empty; this.UserName = String.Empty; this.UserKey = String.Empty; if (c != null) { this.Id = c.Id; this.Email = c.Email; this.EmailConfirmed = c.EmailConfirmed; this.PasswordHash = c.PasswordHash; this.SecurityStamp = c.SecurityStamp; this.PhoneNumber = c.PhoneNumber; this.PhoneNumberConfirmed = c.PhoneNumberConfirmed; this.TwoFactorEnabled = c.TwoFactorEnabled; this.LockoutEndDateUtc = c.LockoutEndDateUtc; this.LockoutEndDateBlank = !c.LockoutEndDateUtc.HasValue; this.LockoutEnabled = c.LockoutEnabled; this.AccessFailedCount = c.AccessFailedCount; this.UserName = c.UserName; this.UserId = c.UserId.HasValue ? c.UserId.Value : Guid.Empty; this.UserKey = c.UserKey; this.UserNickName = c.UserNickName; this.FirstName = c.FirstName; this.LastName = c.LastName; this.UserBio = c.UserBio; } }
public void Save() { using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) { bool bNew = false; carrot_UserData usr = CompiledQueries.cqFindUserTblByID(_db, this.UserId); if (usr == null) { usr = new carrot_UserData(); usr.UserKey = this.UserKey; usr.UserId = Guid.NewGuid(); bNew = true; } usr.UserNickName = this.UserNickName; usr.FirstName = this.FirstName; usr.LastName = this.LastName; usr.UserBio = this.UserBio; if (bNew) { _db.carrot_UserDatas.InsertOnSubmit(usr); } _db.SubmitChanges(); this.UserId = usr.UserId; //grab fresh copy from DB vw_carrot_UserData rc = CompiledQueries.cqFindUserByID(_db, usr.UserId); LoadUserData(rc); } }
public ExtendedUserData(Guid UserID) { using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) { vw_carrot_UserData rc = CompiledQueries.cqFindUserByID(_db, UserID); LoadUserData(rc); } }
public ExtendedUserData(string UserName) { using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) { vw_carrot_UserData rc = CompiledQueries.cqFindUserByName(_db, UserName); LoadUserData(rc); } }
public static ExtendedUserData FindByUserID(Guid UserID) { ExtendedUserData usr = new ExtendedUserData(); using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) { vw_carrot_UserData rc = CompiledQueries.cqFindUserByID(_db, UserID); usr.LoadUserData(rc); } return(usr); }
public static ExtendedUserData FindByEmail(string Email) { ExtendedUserData usr = new ExtendedUserData(); using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) { vw_carrot_UserData rc = CompiledQueries.cqFindUserByEmail(_db, Email); usr.LoadUserData(rc); } return(usr); }
internal ExtendedUserData(vw_carrot_UserData c) { if (c != null) { this.UserId = c.UserId; this.UserNickName = c.UserNickName; this.FirstName = c.FirstName; this.LastName = c.LastName; this.EmailAddress = c.LoweredEmail; this.IsLockedOut = c.IsLockedOut; this.UserName = c.UserName; this.LastActivityDate = c.LastActivityDate; this.CreateDate = c.CreateDate; this.LastLoginDate = c.LastLoginDate; this.UserBio = c.UserBio; } }
private void LoadUserData(vw_carrot_UserData c) { this.UserId = Guid.Empty; this.EmailAddress = ""; this.UserName = ""; if (c != null) { this.UserId = c.UserId; this.UserNickName = c.UserNickName; this.FirstName = c.FirstName; this.LastName = c.LastName; this.EmailAddress = c.LoweredEmail; this.IsLockedOut = c.IsLockedOut; this.UserName = c.UserName; this.LastActivityDate = c.LastActivityDate; this.CreateDate = c.CreateDate; this.LastLoginDate = c.LastLoginDate; this.UserBio = c.UserBio; } }
internal ExtendedUserData(vw_carrot_UserData c) { LoadUserData(c); }