public FeedController() { feedService = new FeedService(); friendService = new FriendService(); visitorService = new VisitorService(); followService = new FollowerService(); }
public FriendController() { followService = new FollowerService(); friendService = new FriendService(); userService = new UserService(); blacklistService = new BlacklistService(); LayoutControllerType = typeof( MicroblogController ); }
public MicroblogService() { feedService = new FeedService(); nfService = new NotificationService(); friendService = new FriendService(); followerService = new FollowerService(); }
public PhotoPostService() { friendService = new FriendService(); pickedService = new PickedService(); incomeService = new UserIncomeService(); followerService = new FollowerService(); }
public virtual void DeleteFriend(long userId, long fid, String ip) { FollowerService followService = new FollowerService(); String condition = "User.Id=" + userId + " and Friend.Id=" + fid + " and Status=" + FriendStatus.Approved; FriendShip ship = db.find <FriendShip>(condition).first(); if (ship != null) { db.delete(ship); if (followService.IsFollowing(userId, fid) == false) { followService.Follow(userId, fid, ip); } recountFriends(userId); recountFriends(fid); return; } condition = "User.Id=" + fid + " and Friend.Id=" + userId + " and Status=" + FriendStatus.Approved; ship = db.find <FriendShip>(condition).first(); if (ship != null) { db.delete(ship); if (followService.IsFollowing(fid, userId) == false) { followService.Follow(fid, userId, ip); } recountFriends(userId); recountFriends(fid); } }
public ViewerContext( MvcContext ctx ) { friendService = new FriendService(); msgService = new MessageService(); followService = new FollowerService(); this.ctx = ctx; }
public FriendController() { friendService = new FriendService(); userService = new UserService(); followService = new FollowerService(); blacklistService = new BlacklistService(); }
public virtual Result AddFriend( int userId, int friendId, String msg ) { Result result = CanAddFriend( userId, friendId ); if (result.HasErrors) return result; FriendShip fs = new FriendShip(); User user = userService.GetById( userId ); User friend = userService.GetById( friendId ); fs.User = user; fs.Friend = friend; fs.Msg = msg; fs.Status = FriendStatus.Waiting; result = db.insert( fs ); if (result.IsValid) { string userLink = Link.ToMember( user ); String note = string.Format( "<a href=\"{0}\" target=\"_blank\" class=\"requestUser\">{1}</a> " + lang.get( "requestFriend" ), userLink, user.Name ); if (strUtil.HasText( msg )) { note += "<br/><span class=\"quote\">" + msg + "</span>"; } notificationService.sendFriendRequest( userId, friendId, note ); // 顺带添加关注 FollowerService followService = new FollowerService(); if (followService.IsFollowing( userId, friendId ) == false) followService.Follow( userId, friendId ); } return result; }
public MicroblogCommentsController() { microblogService = new MicroblogService(); followService = new FollowerService(); commentService = new MicroblogCommentService(); LayoutControllerType = typeof( MicroblogController ); }
public ShareController() { feedService = new FeedService(); friendService = new FriendService(); followService = new FollowerService(); shareService = new ShareService(); }
public MicroblogController() { microblogService = new MicroblogService(); followService = new FollowerService(); visitorService = new VisitorService(); mfService = new MicroblogFavoriteService(); commentService = new MicroblogCommentService(); matService = new MicroblogAtService(); userTagService = new UserTagService(); }
public MicroblogController() { microblogService = new MicroblogService(); followService = new FollowerService(); visitorService = new VisitorService(); mfService = new MicroblogFavoriteService(); commentService = new MicroblogCommentService(); matService = new MicroblogAtService(); videoSpider = new WojiluVideoSpider(); }
public HomeController() { microblogService = new MicroblogService(); followService = new FollowerService(); visitorService = new VisitorService(); mfService = new MicroblogFavoriteService(); commentService = new OpenCommentService(); photoPostService = new PhotoPostService(); friendService = new FriendService(); blogAppService = new BlogService(); photoAppService = new PhotoService(); }
public virtual Result AddFriend(long userId, long friendId, String msg, String ip) { Result result = CanAddFriend(userId, friendId); if (result.HasErrors) { return(result); } FriendShip fs = new FriendShip(); User user = userService.GetById(userId); User friend = userService.GetById(friendId); fs.User = user; fs.Friend = friend; fs.Msg = msg; fs.Status = FriendStatus.Waiting; fs.Ip = ip; result = db.insert(fs); if (result.IsValid) { string userLink = Link.ToMember(user); String note = string.Format("<a href=\"{0}\" target=\"_blank\" class=\"requestUser\">{1}</a> " + lang.get("requestFriend"), userLink, user.Name); if (strUtil.HasText(msg)) { note += "<br/><span class=\"quote\">" + msg + "</span>"; } notificationService.sendFriendRequest(userId, friendId, note); // 顺带添加关注 FollowerService followService = new FollowerService(); if (followService.IsFollowing(userId, friendId) == false) { followService.Follow(userId, friendId, ip); } } return(result); }
public virtual void DeleteFriend( long userId, long fid, String ip ) { FollowerService followService = new FollowerService(); String condition = "User.Id=" + userId + " and Friend.Id=" + fid + " and Status=" + FriendStatus.Approved; FriendShip ship = db.find<FriendShip>( condition ).first(); if (ship != null) { db.delete( ship ); if (followService.IsFollowing( userId, fid ) == false) { followService.Follow( userId, fid, ip ); } recountFriends( userId ); recountFriends( fid ); return; } condition = "User.Id=" + fid + " and Friend.Id=" + userId + " and Status=" + FriendStatus.Approved; ship = db.find<FriendShip>( condition ).first(); if (ship != null) { db.delete( ship ); if (followService.IsFollowing( fid, userId ) == false) { followService.Follow( fid, userId, ip ); } recountFriends( userId ); recountFriends( fid ); } }
public virtual void DeleteFriendByBlacklist( int userId, int fid ) { FollowerService followService = new FollowerService(); String condition = "User.Id=" + userId + " and Friend.Id=" + fid + " and Status=" + FriendStatus.Approved; FriendShip ship = db.find<FriendShip>( condition ).first(); if (ship != null) { db.delete( ship ); if (followService.IsFollowing( userId, fid )) followService.DeleteFollow( userId, fid ); recountFriends( userId ); recountFriends( fid ); return; } condition = "User.Id=" + fid + " and Friend.Id=" + userId + " and Status=" + FriendStatus.Approved; ship = db.find<FriendShip>( condition ).first(); if (ship != null) { db.delete( ship ); if (followService.IsFollowing( fid, userId )) followService.DeleteFollow( fid, userId ); recountFriends( userId ); recountFriends( fid ); } }
public BlacklistService() { userService = new UserService(); friendService = new FriendService(); followerService = new FollowerService(); }
public FeedService() { friendService = new FriendService(); followerService = new FollowerService(); nfService = new NotificationService(); }
public ShareCommentsController() { shareService = new ShareService(); followService = new FollowerService(); }
public ViewerContext() { friendService = new FriendService(); msgService = new MessageService(); followService = new FollowerService(); }