예제 #1
0
        private UsersModels GetUserModel(TagIya tagIya)
        {
            UsersModels user = new UsersModels();

            user.OpenId      = OpenIdsModels.ParseOpenIds(tagIya.OpenIdSaTagIyas.ToList());
            user.UserId      = tagIya.UserId;
            user.DisplayName = tagIya.ScreenName;
            user.FullName    = tagIya.RealName;
            if (!string.IsNullOrEmpty(tagIya.Gravatar) && tagIya.Gravatar.Contains("@no-email.com"))
            {
                user.Gravatar = "";
            }
            else
            {
                user.Gravatar = tagIya.Gravatar;
            }
            if (tagIya.BirthDate.HasValue)
            {
                user.Age = (DateTime.Now.Year - tagIya.BirthDate.Value.Year);
            }
            user.Location  = tagIya.Location;
            user.BirthDate = tagIya.BirthDate.HasValue ? tagIya.BirthDate.Value : new DateTime();

            return(user);
        }
예제 #2
0
        public static List<OpenIdsModels> ParseOpenIds(List<OpenIdSaTagIya> OpenIds)
        {
            List<OpenIdsModels> oiList = new List<OpenIdsModels>();
            foreach (OpenIdSaTagIya oiti in OpenIds)
            {
                OpenIdsModels oi = new OpenIdsModels();
                oi.OpenId = oiti.OpenId;
                oi.FriendlyOpenId = oiti.FriendlyOpenId;
                oi.DateCreated = oiti.DateCreated;
                oiList.Add(oi);
            }

            return oiList;
        }
예제 #3
0
        public static List <OpenIdsModels> ParseOpenIds(List <OpenIdSaTagIya> OpenIds)
        {
            List <OpenIdsModels> oiList = new List <OpenIdsModels>();

            foreach (OpenIdSaTagIya oiti in OpenIds)
            {
                OpenIdsModels oi = new OpenIdsModels();
                oi.OpenId         = oiti.OpenId;
                oi.FriendlyOpenId = oiti.FriendlyOpenId;
                oi.DateCreated    = oiti.DateCreated;
                oiList.Add(oi);
            }

            return(oiList);
        }