Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Team ,
In my Asp.net Mvc application , i have module where there are two roles User and Admin. User Can Log in application , can send Message as Subject and Body , we are saving the Subject , and the body matter in the table. Now When admins login he can see the Users Queries Posted in the gridView. In I want to Append the Text , just as Normal Forum , Where I Should main the Conversation Means User sends A particular Message , then admin replied , then User Reply . Please Let Me Know how should i do this ? I want to Append the Earlier Conversations
Posted
Comments
Sergey Alexandrovich Kryukov 9-Nov-14 13:54pm    
What do you mean "how"? By doing some software development work. Any particular concerns?
—SA

1 solution

Mostly people store their information in the Database, so would be you. And since these messages are going to be saved in your server they will be definitely in your database.

Create the columns for the conversation and use another column "ReplyTo" and add the EmailID to it. This would tell you that this conversation message was sent in a response to which Email. Admin sends an email, ReplyTo remains null, User replies to him, for the email that was sent by the User, ReplyTo is filled by the EmailID of the email sent by the admin.

This way, you can continue grouping the emails that were sent in a response to other emails. To show them in a correct order, you can use the ORDER BY DateColumn field in SQL, or you can use the C# LINQ query as emails.OrderBy(x => x.Date)

But there are many other ways of grouping down emails that are meant to be in a single conversation and Gmail does, and CodeProject does for the Comments and Replies.
 
Share this answer
 
Comments
Manas Bhardwaj 9-Nov-14 13:30pm    
well explained +5!
Afzaal Ahmad Zeeshan 9-Nov-14 13:39pm    
Thanks Manas :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900