News/Announcements form?

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I am in the need for a 'News/Announcements' component for my VB.NET
application. Basically, this would allow me to 'push' news items relating to
my application out to my users - i.e Attention: The application is shutting
down; New version of app will be installed on Tuesday; Big issue found in
'whatever' form; etc.

Basically, this component would have to:
1. Be able to display multiple news items at the start of the application.
2. Be able to 'tell' that a user has already viewed a particular news item
and therefore doesn't need to see it again.
3. Must be able to poll occasionally during the execution of the main
application to see if there are any new news or announcement items and alert
the user, especially if they are 'critical' announcments (like 'The
application database is shutting down in 20 minutes' (Maybe this should use
threading? Or would a timer be sufficient? This would be on a main MDI form)

I just wanted to see if anyone has already done this and wouldn't mind
sharing the code (why reinvent the wheel?); otherwise, I'll start writing it
myself. My one sticky point in this is how to tell that a news item has
already been read by the user? Obviously, I'll have to store something
somewhere, just not sure what nor where.

Anyway, just curious if anyone else has designed this or has seen it
somewhere. Thanks.

Tom
 
Tom said:
I am in the need for a 'News/Announcements' component for my VB.NET
application. Basically, this would allow me to 'push' news items relating to
my application out to my users - i.e Attention: The application is shutting
down; New version of app will be installed on Tuesday; Big issue found in
'whatever' form; etc.

You have a common database right? Why not just keep the news-items in
there. Here would be the tables (as I imagin it):

NewsHistory
========
NewsId <int>
Message <varchar>
Priority <tiny_int> '// For critical announcements

UserNews
=========
UserId <int>
NewsId <int>

Whenever you create a news item, add it to the NewsHistory. Then insert it
into the UserNews table for every user in the system. When the user deletes
the news item, delete that NewsId from the UserNews table.

Just think of it as a mail box, where you keep a history of all the mail
ever sent. That sould take care of your #1 and #2 problems.

3. Must be able to poll occasionally during the execution of the main
application to see if there are any new news or announcement items and alert
the user, especially if they are 'critical' announcments (like 'The
application database is shutting down in 20 minutes' (Maybe this should use
threading? Or would a timer be sufficient? This would be on a main MDI
form)

If you want a super-tight integration, there is a way to hookup a DLL to SQL
Server and make it notify your app every time a record is inserted - but
this is very advanced (see article on MSDN). Personally, I would check when
the app starts, and then check again every 10 minutes.

The method you use to poll the system is entirly up to your level of
programming skill. If you think you are profecient with Threads, you could
do that, but it would probably be overkill (a timer would be a good
alternative). If it's a closed network that all the clients exist in, then
remoting would also be a possibility. In the case of remoting, you could
actually create a message inserter program that would notify all the clients
when you created a new message for them to read.

HTH,
Jeremy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top