Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need an alert function in c#, when the employee logs into the system, he gets an alert message saying he has a renewal due in a week?

IM new to c#, and coding is not my specialty. This is an assignment submission.

This is a windows form app.

Renewal details are in a renewal table and employee/user details are in another table; I can use queries to join them / link it.

Static alert; just reminder the employee of the renewal


kindly help me.. Thanks

What I have tried:

Im clueless, and coding is not my field of specialty

I made the db, and other parts of the assignment, such as creating the renewal , editing and viewing.

I was thinking of geting the user ID and connecting to the user profile table and then connecting that to the renewal ID , and displaying the alert or reminder..


but im not sure how to code it..
Posted
Updated 30-Aug-16 23:39pm
v2
Comments
Andy Lanng 31-Aug-16 5:33am    
So many questions, so few answers.
It's hard to answer such an open question without any detail. There are so many options.
First off, please edit the question with the green "Improve question" button and answer the following:
Are you using a web form or windows form?
Can you get the renewal from the userid / username
do you need a functional alert (click here to blah blah) or a static one.

Depending on the answers I may have some follow up questions, but these'll do for now ^_^

1 solution

Add a column to your Users table which is a RenewalDate - when the user logs in, check the value against the current date less the "reminder period"
That's almost trivial in C#:
C#
DateTime renewOn = ... get your renew date value from your DB ...
if (renewOn <= DateTime.Now.AddDays(7).Date)
   {
   ... renewal needed

Then all you have to do is show the alert to the user - which again is pretty trivial, but depends on what kind of system you are coding for, and exactly how you want to display it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900