private LCLMembershipUser ConvertFrom(User userObj)
        {
            if (userObj == null)
            {
                return(null);
            }

            LCLMembershipUser user = new LCLMembershipUser("LCLMembershipProvider",
                                                           userObj.UserName,
                                                           userObj.ID,
                                                           userObj.Email,
                                                           "",
                                                           "",
                                                           true,
                                                           userObj.IsDisabled,
                                                           userObj.DateRegistered,
                                                           userObj.DateLastLogon,
                                                           DateTime.MinValue,
                                                           DateTime.MinValue,
                                                           DateTime.MinValue,
                                                           userObj.Contact,
                                                           userObj.PhoneNumber,
                                                           userObj.ContactAddress,
                                                           userObj.DeliveryAddress);

            return(user);
        }
        public LCLMembershipUser CreateUser(string username,
                                            string password,
                                            string email,
                                            string passwordQuestion,
                                            string passwordAnswer,
                                            bool isApproved,
                                            object providerUserKey,
                                            string contact,
                                            string phoneNumber,
                                            Address contactAddress,
                                            Address deliveryAddress,
                                            out MembershipCreateStatus status)
        {
            ValidatePasswordEventArgs args = new ValidatePasswordEventArgs(username, password, true);

            OnValidatingPassword(args);
            if (args.Cancel)
            {
                status = MembershipCreateStatus.InvalidPassword;
                return(null);
            }
            if (RequiresUniqueEmail && !string.IsNullOrEmpty(GetUserNameByEmail(email)))
            {
                status = MembershipCreateStatus.DuplicateEmail;
                return(null);
            }
            LCLMembershipUser user = GetUser(username, true) as LCLMembershipUser;

            if (user == null)
            {
                var userDataObjects = new List <User>
                {
                    new User
                    {
                        UserName        = username,
                        Password        = password,
                        Contact         = contact,
                        DateLastLogon   = null,
                        DateRegistered  = DateTime.Now,
                        Email           = email,
                        IsDisabled      = false,
                        PhoneNumber     = phoneNumber,
                        ContactAddress  = contactAddress,
                        DeliveryAddress = deliveryAddress
                    }
                };
                RF.Service <IUserService>().CreateUsers(userDataObjects);
                status = MembershipCreateStatus.Success;
                return(GetUser(username, true) as LCLMembershipUser);
            }
            else
            {
                status = MembershipCreateStatus.DuplicateUserName;
                return(null);
            }
        }