public TransactionComment(int commentId, string comment, ActionBy actionBy, Transaction transaction) { CommentId = commentId; Comment = comment; TransactionId = transaction.TransactionId; Details = new TransactionDetailModel(transaction); }
public TransactionComment(int commentId, string comment, ActionBy actionBy, Transaction transaction) { CommentId = commentId; Comment = comment; TransactionId = transaction.TransactionId; Details = new TransactionDetailModel(transaction); }
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; } } }
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; } } }