Ejemplo n.º 1
0
 public TransactionComment(int commentId, string comment, ActionBy actionBy, Transaction transaction)
 {
     CommentId     = commentId;
     Comment       = comment;
     TransactionId = transaction.TransactionId;
     Details       = new TransactionDetailModel(transaction);
 }
Ejemplo n.º 2
0
 public TransactionComment(int commentId, string comment, ActionBy actionBy, Transaction transaction)
 {
     CommentId = commentId;
     Comment = comment;
     TransactionId = transaction.TransactionId;
     Details = new TransactionDetailModel(transaction);
 }
Ejemplo n.º 3
0
        public TransactionCommentModel(Transaction transaction, string userName)
        {
            Details         = new TransactionDetailModel(transaction);
            profile         = ProfileHandler.GetProfile(userName);
            UserId          = profile.ProfileId;
            UserDisplayName = profile.Name;
            UserFacebookId  = profile.FacebookId;

            if (UserId == transaction.BuyerId)
            {
                CounterPartyId = transaction.SellerId;
                UserAction     = ActionBy.Buyer;
            }
            else
            {
                CounterPartyId = transaction.BuyerId;
                UserAction     = ActionBy.Seller;
            }

            Profile counterPartyProfile = ProfileHandler.GetProfile(CounterPartyId);

            CounterPartyDisplayName = counterPartyProfile.Name;
            CounterPartyFacebookId  = counterPartyProfile.FacebookId;

            // load comments
            Comments = CommentHandler.getComments(transaction.TransactionId);
            foreach (Comment comment in Comments)
            {
                if (comment.UserId == UserId)
                {
                    comment.CommentByCurrentUser = true;
                }
                else
                {
                    comment.CommentByCurrentUser = false;
                }
            }
        }
Ejemplo n.º 4
0
        public TransactionCommentModel(Transaction transaction, string userName)
        {
            Details = new TransactionDetailModel(transaction);
            profile = ProfileHandler.GetProfile(userName);
            UserId = profile.ProfileId;
            UserDisplayName = profile.Name;
            UserFacebookId = profile.FacebookId;

            if (UserId == transaction.BuyerId)
            {
                CounterPartyId = transaction.SellerId;
                UserAction = ActionBy.Buyer;
            }
            else
            {
                CounterPartyId = transaction.BuyerId;
                UserAction = ActionBy.Seller;
            }

            Profile counterPartyProfile = ProfileHandler.GetProfile(CounterPartyId);
            CounterPartyDisplayName = counterPartyProfile.Name;
            CounterPartyFacebookId = counterPartyProfile.FacebookId;

            // load comments
            Comments = CommentHandler.getComments(transaction.TransactionId);
            foreach (Comment comment in Comments)
            {
                if (comment.UserId == UserId)
                {
                    comment.CommentByCurrentUser = true;
                }
                else
                {
                    comment.CommentByCurrentUser = false;
                }
            }
        }