- set up database
- set up data-processing controller and communicating-channel controller
- CRUD functionality in MVP (with template provided by VS)
For calendar view
- auto-generated monthly view
- when there's an event month matching the month, put the event on the corresponding spot on the calendar.
For event table
- look up info for: how to present info from the database
MonthCalendar example from microsoft documentation (not recommended) https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.monthcalendar?view=net-5.0
HOW DO I:
- link this to event database and view
- Collect information from my event database and bind them with the monthcalendar class
- Display them with a view
- display events within a particular date range of a month (starttime, endtime)
-
SQL
- select * from events where eventtime > starttime and eventtime < endtime
-
LINQ
- db.events.where(e=>e.eventtime>startime && e.eventtime<endtime)
-
Generate a list of all of the days that appear between starttime and endtime. Use much simpler functions like this one https://docs.microsoft.com/en-us/dotnet/api/system.datetime.dayofweek?view=netframework-4.7.2#code-try-1. Use a loop to count the days between the start of the month (starttime) and the end of the month (endtime). On all the dates between this range, and pass them from your controller to your view.
-
Use HTML view to display the calendar View can describe some HTML for each day. The day can be an HTML div element, with another span element inside to represent which day of the week it is. If there is an event scheduled for that day, you can include that as well.
See event controller line 20. Change the ActionResult function to loop through events and create monthly view.
- Relating class contents:
- Module 7: (about one hour in the video) about view model
- See also: varsity example, displaying team info (with multiple tables)
- See also: wireframing.pdf fig 3