示例#1
0
        /// <summary>
        /// 更改主题
        /// </summary>
        /// <param name="userpro"></param>
        public void  ModifyUserTheme(UserPropertyDspModel userpro)
        {
            IRepository <UserProperty> profileRep = Factory.Factory <IRepository <UserProperty> > .GetConcrete <UserProperty>();

            UserProperty p = profileRep.Find(new Specification <UserProperty>(c => c.UserID == userpro.UserID));

            if (p != null)
            {
                p.UserID    = userpro.UserID;
                p.BlogTheme = userpro.BlogTheme;
            }
            profileRep.Update(p);
            profileRep.PersistAll();
        }
示例#2
0
        public UserPropertyDspModel GetUserPropertyByID(Guid aid)
        {
            IRepository <UserProperty> profileRep = Factory.Factory <IRepository <UserProperty> > .GetConcrete <UserProperty>();

            UserProperty         p     = profileRep.Find(new Specification <UserProperty>(k => k.UserID == aid));
            UserPropertyDspModel model = null;

            if (p != null)
            {
                model = new UserPropertyDspModel()
                {
                    BlogTheme = p.BlogTheme, Id = p.Id, Brief = p.Brief, Display = p.Display, FolloweesCount = p.FolloweesCount, FollowersCount = p.FollowersCount, Type = p.Type, UserID = p.UserID, BlogName = p.BlogName
                };
            }
            return(model);
        }
示例#3
0
        public UserInfoModel GetUserInfoModel(Guid id)
        {
            //IAccountRepository accRep = Factory.Factory<IAccountRepository>.GetConcrete();
            IRepository <Account> accRep = Factory.Factory <IRepository <Account> > .GetConcrete <Account>();

            Account       user = null;
            UserInfoModel usm  = null;

            user = accRep.GetByKey(id);
            UserPropertyDspModel sm = this.GetUserProperty(id);

            usm = new UserInfoModel()
            {
                UserTiny = user.UserHead, Followees = sm.FolloweesCount, Followers = sm.FollowersCount, UserHead = user.UserHead, UserID = user.Id, UserName = user.UserName
            };

            return(usm);
        }
示例#4
0
        /// <summary>
        /// 获取用户属性
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public UserPropertyDspModel GetUserProperty(Guid id)
        {
            IRepository <UserProperty> uRep = Factory.Factory <IRepository <UserProperty> > .GetConcrete <UserProperty>();

            UserProperty         up    = uRep.Find(new Specification <UserProperty>(s => s.UserID == id));
            UserPropertyDspModel model = new UserPropertyDspModel();

            if (up != null)
            {
                model.BlogName       = up.BlogName;
                model.BlogTheme      = up.BlogTheme;
                model.Brief          = up.Brief;
                model.FolloweesCount = up.FolloweesCount;
                model.FollowersCount = up.FollowersCount;
                model.UserID         = up.UserID;
                model.Type           = up.Type;
            }
            return(model);
        }