Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 public ExtendedUserData(Guid UserID)
 {
     using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) {
         vw_carrot_UserData rc = CompiledQueries.cqFindUserByID(_db, UserID);
         LoadUserData(rc);
     }
 }
Exemplo n.º 4
0
 public ExtendedUserData(string UserName)
 {
     using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) {
         vw_carrot_UserData rc = CompiledQueries.cqFindUserByName(_db, UserName);
         LoadUserData(rc);
     }
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
 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;
     }
 }
Exemplo n.º 8
0
 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;
			}
		}
Exemplo n.º 10
0
        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;
            }
        }
Exemplo n.º 11
0
		internal ExtendedUserData(vw_carrot_UserData c) {
			LoadUserData(c);
		}
Exemplo n.º 12
0
		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;
			}
		}
Exemplo n.º 13
0
 internal ExtendedUserData(vw_carrot_UserData c)
 {
     LoadUserData(c);
 }