Exemple #1
0
 public FriendController()
 {
     friendService = new FriendService();
     userService = new UserService();
     followService = new FollowerService();
     blacklistService = new BlacklistService();
 }
Exemple #2
0
 public MsgController()
 {
     msgService = new MessageService();
     blacklistService = new BlacklistService();
     userService = new UserService();
     attachmentService = new MessageAttachmentService();
 }
Exemple #3
0
 public FriendController()
 {
     followService = new FollowerService();
     friendService = new FriendService();
     userService = new UserService();
     blacklistService = new BlacklistService();
     LayoutControllerType = typeof( MicroblogController );
 }
Exemple #4
0
        public virtual Result CanAddFriend(long userId, long targetId)
        {
            Result result = new Result();

            if (userId <= 0)
            {
                result.Add(lang.get("exPlsLogin"));
                return(result);
            }

            if (userId == targetId)
            {
                result.Add(lang.get("exFriendSelf"));
                return(result);
            }

            User f = userService.GetById(targetId);

            if (f == null)
            {
                result.Add(lang.get("exUser"));
                return(result);
            }

            BlacklistService blacklistService = new BlacklistService();

            if (blacklistService.IsBlack(targetId, userId))
            {
                result.Add(lang.get("blackFriend"));
            }
            else if (IsFriend(userId, targetId))
            {
                result.Add(lang.get("exFriendBeen"));
            }
            else if (IsWaitingFriendApproving(userId, targetId))
            {
                result.Add(lang.get("inApproveFriend"));
            }

            return(result);
        }
Exemple #5
0
        public Result CanAddFriend( int userId, int targetId )
        {
            Result result = new Result();

            if (userId <= 0) {
                result.Add( lang.get( "exPlsLogin" ) );
                return result;
            }

            if (userId == targetId) {
                result.Add( lang.get( "exFriendSelf" ) );
                return result;
            }

            User f = userService.GetById( targetId );
            if (f == null) {
                result.Add( lang.get( "exUser" ) );
                return result;
            }

            BlacklistService blacklistService = new BlacklistService();

            if (blacklistService.IsBlack( targetId, userId )) {
                result.Add( lang.get( "blackFriend" ) );
            }
            else if (IsFriend( userId, targetId )) {
                result.Add( lang.get( "exFriendBeen" ) );
            }
            else if (IsWaitingFriendApproving( userId, targetId )) {
                result.Add( lang.get( "inApproveFriend" ) );
            }

            return result;
        }
 public FeedbackController()
 {
     feedbackService = new FeedbackService();
     blacklistService = new BlacklistService();
 }
Exemple #7
0
 public VisitorController()
 {
     visitorService = new wojilu.Common.Visitors.VisitorService();
     blacklistService = new BlacklistService();
 }
Exemple #8
0
 public MessageService()
 {
     blacklistService = new BlacklistService();
 }
Exemple #9
0
 public BlacklistController()
 {
     base.LayoutControllerType = typeof( FriendController );
     blacklistService = new BlacklistService();
 }