Пример #1
0
        public bool Save(Kooboo.Connect.User account)
        {
            var find = this.GetDataContext().Users
             .Where(i => i.Name == account.Name)
             .FirstOrDefault();

            if (find == null)
            {
                find = new User();
                this.GetDataContext().Users.InsertOnSubmit(find);
            }
            find.Name = account.Name;
            find.Email = account.Email;

            find.PasswordSalt = account.Membership.PasswordSalt;
            find.Password = account.Membership.Password;

            find.Comment = account.Membership.Comment;
            find.CreateDate = account.Membership.CreateDate;
            find.FailedPasswordAnswerAttemptCount = account.Membership.FailedPasswordAnswerAttemptCount;
            find.FailedPasswordAnswerAttemptWindowStart = account.Membership.FailedPasswordAnswerAttemptWindowStart;
            find.FailedPasswordAttemptCount = account.Membership.FailedPasswordAttemptCount;
            find.FailedPasswordAttemptWindowStart = account.Membership.FailedPasswordAttemptWindowStart;
            find.IsApproved = account.Membership.IsApproved;
            find.IsLockedOut = account.Membership.IsLockedOut;
            find.LastLockoutDate = account.Membership.LastLockoutDate;
            find.LastLoginDate = account.Membership.LastLoginDate;
            find.LastPasswordChangedDate = account.Membership.LastPasswordChangedDate;

            find.PasswordAnswer = account.Membership.PasswordAnswer;
            find.PasswordQuestion = account.Membership.PasswordQuestion;

            if (account.Profile!=null)
            {
                find.Address = account.Profile.Address;
                find.Birthday = account.Profile.Birthday;
                find.City = account.Profile.City;
                find.Country = account.Profile.Country;
                find.FirstName = account.Profile.FirstName;
                find.Gender = account.Profile.Gender;
                find.LastName = account.Profile.LastName;
                find.MiddleName = account.Profile.MiddleName;
                find.Mobile = account.Profile.Mobile;
                find.Postcode = account.Profile.Postcode;
                find.Telphone = account.Profile.Telphone;
            }

            this.GetDataContext().SubmitChanges();

            return true;
        }
Пример #2
0
 partial void UpdateUser(User instance);
Пример #3
0
 partial void DeleteUser(User instance);
Пример #4
0
 partial void InsertUser(User instance);