I have an application written in c# to allow users to manage events, when adding I allow the users to add a repeat type of Daily,Monthly,Weekly and another option to select how many times it should be repeated or till what day it should be repeated.
(我有一个用c#编写的应用程序,允许用户管理事件,添加时,我允许用户添加重复类型“每日”,“每月”,“每周”,并提供另一个选项来选择应重复多少次或直到哪一天。重复。)
Now when displaying the events I need to show all the events that are available for a week.
(现在,在显示事件时,我需要显示一周内可用的所有事件。)
EX: The user adds an event today and that event repeats daily for 30 days
(例如:用户今天添加了一个活动,该活动每天重复30天)
When displaying the events I query for events using
(显示事件时,我使用查询事件)
var events = db.Evnt.Where(l => l.repeatTill >= weekEnd).ToList()
Once I get the results I need to generate the repeating events and display them to the user, How can I achieve this
(获得结果后,我需要生成重复事件并将其显示给用户,我该如何实现)
Final output should be something like this
(最终输出应该是这样的)
E1
11/24/2019 10:00 - 11/24/2019 11:00
E1
11/25/2019 10:00 - 11/25/2019 11:00
E1
11/26/2019 10:00 - 11/26/2019 11:00
E1
11/27/2019 10:00 - 11/27/2019 11:00
E1
11/28/2019 10:00 - 11/28/2019 11:00
E1
11/29/2019 10:00 - 11/29/2019 11:00
E1
11/30/2019 10:00 - 11/30/2019 11:00
E1
12/01/2019 10:00 - 12/01/2019 11:00
If the user filters from 11/24/2019 - 12/08/2019 the output should be
(如果用户从11/24/2019-12/08/2019进行过滤,则输出应为)
E1
11/24/2019 10:00 - 11/24/2019 11:00
E1
11/25/2019 10:00 - 11/25/2019 11:00
E1
11/26/2019 10:00 - 11/26/2019 11:00
E1
11/27/2019 10:00 - 11/27/2019 11:00
E1
11/28/2019 10:00 - 11/28/2019 11:00
E1
11/29/2019 10:00 - 11/29/2019 11:00
E1
11/30/2019 10:00 - 11/30/2019 11:00
E1
12/01/2019 10:00 - 12/01/2019 11:00
E1
12/02/2019 10:00 - 12/02/2019 11:00
E1
12/03/2019 10:00 - 12/03/2019 11:00
E1
12/04/2019 10:00 - 12/04/2019 11:00
E1
12/05/2019 10:00 - 12/05/2019 11:00
E1
12/06/2019 10:00 - 12/06/2019 11:00
E1
12/07/2019 10:00 - 12/07/2019 11:00
E1
12/08/2019 10:00 - 12/08/2019 11:00
How can I achieve this?
(我该如何实现?)
ask by mike oconner translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…