为不同的用户生成不同的生日问候邮件 [英] generate different birthday greeting mails for different users

查看:77
本文介绍了为不同的用户生成不同的生日问候邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个应用程序,它将向我公司的所有成员发送生日邮件.
例如今天是生日,它将向包括我在内的所有公司成员发送问候邮件.
因此,问题在于,如果明天是另一个员工的生日,那么发送给我的贺卡不应发送同一张卡片,而应该发送另一张卡片(下一张卡片).

我有3张贺卡,
因此,如果将1st发送给我,则应该将2nd发送到下一个生日.
所以我想我将使用会话存储第一张卡的名称,并在下一个生日它将发送另一张卡.
将卡名称复制到数据库表中会更容易.
我的要求是卡名不应保存在表中,而应保存在客户端.因此,如果我们使用会话或应用程序状态,视图状态或隐藏字段,它将存储多少时间值.
如果今天是生日,两个月后又是另一个生日,那么应该将卡名保存两个月.怎么可能.
谢谢
sriivasa


I have an application which will send birthday mail to all my company members.
for example today is birthday it will send greeting mail to all company members including me.
so the issue is that if tomorrow is another employee birthday the greeting card which is sent to me should not sent same card, it should send another card(next card).

i have 3 greeting cards,
so if 1st is send to me then it should send 2nd to next birthday date.
so i thought i will use session to store the 1st card name and on next birthday it will send the another card.
it will be easier to copy the card name in database table.
my requirement is the card name should not save in table and it should save in client side. so if we use session or application state or viewstate or hidden fields how much time it will store values.
if today is birthday and after 2 months is another birthday so it should save card name for 2 months .how it is possible.
thanks
sriivasa

推荐答案

您需要一些良好的逻辑来做到这一点.让我来解决这个问题.从您的问题中我了解到:

1)您需要一个生日贺卡管理员.
2)您的库存中有三张贺卡.
3)您需要确保如果将第一个问候发送给当月有生日的人,并且如果另一个人在该月具有相同的生日,则您要发送下一张问候卡.

首先,正如您询问是否可以将旧贺卡索引存储在SessionState或ApplicationState或ViewState或HiddenFields中一样,答案是肯定的,不是,因为SessionState,ApplicationState是在IIS时会被丢弃的两个变量.重新启动(如果您有其他保存方式,可以将其保留).当涉及到ViewState时,您无法永远保存该索引.这只是页面级的东西;与HiddenFields相同-ViewState条目与HiddenField一样,只不过它是根据配置方式进行编码或加密的事实.

现在出现了更有趣的部分,即逻辑.
据我所知,我猜该逻辑可以通过以下方式实现.

假设Employees表结构如下:
You need some good logic to do that. Let me break down the problem. As I understand from your problem that:

1) You need a birthday greeting card manager.
2) You have three greeting cards in stock.
3) You need to make sure that if the first greeting is sent to the person who has his birthday in the current month and if another person is having the same birthdate in that month, then you send the next greeting card.

First of all, as you have asked whether you can store the Old Greeting Card index in SessionState or ApplicationState or ViewState or HiddenFields, the answer is yes and no it is because the SessionState, ApplicationState are the two variables which get disposed of when the IIS restarts (if you have any other way to save it, you can persist it). When it comes to ViewState, you just cant save that index forever. It is only a page level thing; same is with HiddenFields - A ViewState entry is just like HiddenField except the fact that it is encoded or encrypted depending upon how it is configured.

Now comes the more interesting part, the logic.
As far I think, I guess the logic can be implemented in the following way.

Suppose the Employees table structure is as follows:
Employees
    EmployeeID
    FirstName
    LastName
    DateOfBirth



还有另一个名为GreetingCard的表,其结构如下.



There is another table called GreetingCard and its structure is as follows.

GreetingCard
    GreetingCardID
    GreetingCardPath



最后但并非最不重要的一点是,有一个名为GreetingLog的表,其结构如下



And last but not the least, there is a table called GreetingLog whose structure is as follows

GreetingLog
    LogID
    GreetingCardID
    EmployeeID
    LastUseDate



GreetingLog表将为您提供足够的信息,以猜测下一位员工的最佳贺卡.您还将获得有关哪个雇员获得了哪张贺卡的信息.



The GreetingLog table will provide you enough information to guess the best greeting card for the next employee. You will also get the information about which employee got which greeting card.


这篇关于为不同的用户生成不同的生日问候邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆