Ejemplo n.º 1
0
        public IUserFull CreateUser()
        {
            var user = new UserFull();

            user.Id       = GetRandomBetween(0, 32767);
            user.UserName = Environment.UserName.ToLower();

            var userNameParts = Environment.UserName.Split(new char[] { '.' });

            user.Name = GetCamelCaseText(userNameParts[0]);
            if (userNameParts.Length > 1)
            {
                user.SurName = GetCamelCaseText(userNameParts[1]);
            }
            user.BirthDate = GetRandomBirthDate();

            user.Interests = new System.Collections.Generic.List <InterestInfo>
            {
                new InterestInfo
                {
                    Interest  = "Philosopfy",
                    Interests = new List <InterestInfo>
                    {
                        new InterestInfo("Behavior"),
                        new InterestInfo("Communications")
                    }
                },
                new InterestInfo
                {
                    Interest  = "Music",
                    Interests = new List <InterestInfo>
                    {
                        new InterestInfo("Jazz"),
                        new InterestInfo("Pop"),
                        new InterestInfo("Rock")
                        {
                            Interests = new List <InterestInfo>
                            {
                                new InterestInfo("Heavy"),
                                new InterestInfo("Symphonic")
                            }
                        },
                        new InterestInfo("Classic"),
                        new InterestInfo("Rap"),
                        new InterestInfo("New age"),
                    }
                },
                new InterestInfo
                {
                    Interest  = "Sports",
                    Interests = new List <InterestInfo>
                    {
                        new InterestInfo("Running"),
                        new InterestInfo("Body building"),
                        new InterestInfo("Tennis"),
                        new InterestInfo("Horses"),
                        new InterestInfo("Football")
                        {
                            Interests = new List <InterestInfo>
                            {
                                new InterestInfo("American"),
                                new InterestInfo("Soccer")
                            }
                        },
                        new InterestInfo("Baseball"),
                    }
                }
            };

            return(user);
        }
Ejemplo n.º 2
0
 public override void OnResponse(BinaryReader reader)
 {
     userFull = TLObject.Read <UserFull>(reader);
 }
Ejemplo n.º 3
0
        private UserFull GetAccountData(UserFull userModification)
        {
            MembershipUser        mu = Membership.GetUser();
            List <SelectListItem> securityQuestionList = new List <SelectListItem>();
            List <SelectListItem> userSizeList         = new List <SelectListItem>();
            List <SelectListItem> privacyList          = new List <SelectListItem>();

            if (mu != null)
            {
                RegisteredUser   ru = registeredUserRepository.GetByMembershipId(Convert.ToInt32(mu.ProviderUserKey));
                SecurityQuestion securityQuestion = securityQuestionRepository.GetByDescription(mu.PasswordQuestion);
                userModification = new UserFull(ru, securityQuestion.Id, userModification.Alert, userModification.Tab);

                IList <SecurityQuestion> questions = securityQuestionRepository.GetAll();
                foreach (SecurityQuestion question in questions)
                {
                    SelectListItem sl = new SelectListItem();
                    sl.Text  = question.Description;
                    sl.Value = question.Id.ToString();
                    if (question.Description == securityQuestion.Description)
                    {
                        sl.Selected = true;
                    }
                    securityQuestionList.Add(sl);
                }

                IList <UserSize> userSizes = userSizeRepository.GetAll();
                foreach (UserSize userSize in userSizes)
                {
                    SelectListItem sli = new SelectListItem();
                    sli.Text  = userSize.Description;
                    sli.Value = userSize.Id.ToString();
                    if (userSize.Id == ru.Size.Id)
                    {
                        sli.Selected = true;
                    }
                    userSizeList.Add(sli);
                }

                SelectListItem pvy = new SelectListItem();
                pvy.Text  = "My Closet can be viewed by me only";
                pvy.Value = PrivacyLevel.Private.ToString();
                if (ru.Closet.PrivacyLevel == PrivacyLevel.Private)
                {
                    pvy.Selected = true;
                }
                privacyList.Add(pvy);
                pvy       = new SelectListItem();
                pvy.Text  = "My Closet can be viewed by me and my friends";
                pvy.Value = PrivacyLevel.Friends.ToString();
                if (ru.Closet.PrivacyLevel == PrivacyLevel.Friends)
                {
                    pvy.Selected = true;
                }
                privacyList.Add(pvy);
                pvy       = new SelectListItem();
                pvy.Text  = "Only my Signature Outfit can be viewed by anyone";
                pvy.Value = PrivacyLevel.FavoriteOutfit.ToString();
                if (ru.Closet.PrivacyLevel == PrivacyLevel.FavoriteOutfit)
                {
                    pvy.Selected = true;
                }
                privacyList.Add(pvy);
                pvy       = new SelectListItem();
                pvy.Text  = "My Entire Closet can be viewed by anyone";
                pvy.Value = PrivacyLevel.FullCloset.ToString();
                if (ru.Closet.PrivacyLevel == PrivacyLevel.FullCloset)
                {
                    pvy.Selected = true;
                }
                privacyList.Add(pvy);
            }

            ViewData["SecurityQuestions"] = securityQuestionList;
            ViewData["UserSizes"]         = userSizeList;
            ViewData["PrivacyStatus"]     = privacyList;
            if (mu != null)
            {
                ViewData["UserName"] = mu.UserName;
            }

            return(userModification);
        }
Ejemplo n.º 4
0
 private void OnEditUser(UserFull user)
 {
     AddEditUserRequested(user);
 }