Implementations GUI details
When creating a GUI you must think to give user some good feeling about what the software can do – so I started to MVC 4 website, that have mobile support integrated.
More, you must demonstrate some features right away to the user – so what’s best if not a message from system admin to the user to “welcome” him ?
For this , I have to implement a template with RazorEngine – simple to used from his code
string template = "Hello @Model.Name! Welcome to Razor!"; string result = Razor.Parse(template, new { Name = "World" });
Summary of modifications for this simple operation – send and display a message from Admin when a user registers
- Add connectionstrings to web.config – to connect to database + SiteUtils static class to retrieve it.
- RegisterAdmin user in Application_Start – in order to have user Admin in the database ( generate a GUID and put into a const)
- Add “welcome.txt” file
- Add RazorEngine to parse message
- Modify Register action in order to send message after a user registers
- Add an area “Messaging” in order to can have the messaging separated from main site( to be easier to xcopy)
- Add an Index action( display read/unread messages) + View
- Add an DisplayMessage action (display a message) + View
All for this picture where it shows number of unread messages(1) and list :
You will find code at http://messagemvc.codeplex.com/SourceControl/changeset/changes/81924
Homework:
Think about the user actions . He will be interested in the following for existing messages:
- Unread messages
- View of all messages (paginating)
- Search messages:
- Messages from a date
- Messages from someone
- Search
What do you think it will be done for implementing those?
Leave a Reply