Asp.net Mvc - 邮件应用程序

问题描述:

Hi Team,

在我的Asp.net Mvc应用程序中,我有模块,其中有两个角色User和Admin。用户可以登录应用程序,可以作为主题和正文发送消息,我们正在保存主题,并在表中保存正文。现在当管理员登录时,他可以在gridView中看到发布的用户查询。在我想要附加文本,就像普通论坛,我应该主要的对话意味着用户发送一个特定的消息,然后管理员回复,然后用户回复。请让我知道我该怎么做?我想附加较早的对话

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

大多数人将他们的信息存储在数据库中,所以你也应该如此。由于这些消息将保存在您的服务器中,因此它们肯定会存储在您的数据库中。



为对话创建列并使用另一列ReplyTo并向其添加EmailID。这将告诉您此对话消息是在对哪个电子邮件的响应中发送的。管理员发送电子邮件,ReplyTo保持为空,用户回复他,对于用户发送的电子邮件,ReplyTo由管理员发送的电子邮件的EmailID填写。



这样,您就可以继续将响应中发送的电子邮件分组到其他电子邮件中。要以正确的顺序显示它们,可以使用SQL中的 ORDER BY DateColumn 字段,或者可以将C#LINQ查询用作 emails.OrderBy (x => x.Date)



但是还有很多其他方法可以将电子邮件分组到单个电子邮件中对话和Gmail一样,CodeProject为评论和回复做了。
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.