Search code examples
c#reminders

Alarm with Text Reminder in C#


I'm working with an alarm app using C#.

Firstly, I have a Form named AddReminder.cs which take Year, Month, Day, Hour, Min and some description about what to do in that time. If I click a button named Add Reminder then it all information will save in database/pc. It will be able to add many reminder as I want.

Then I have another form named MyReminder.cs which will match the times from database/pc and give me message and a alarm. I want to say, while the pc time will be exactly the saved or reminder time then this form will be executed.

Now My questions are:

  1. How can I save multiple reminder in database or pc?
  2. How MyReminder.cs will compare with those datas and execute with alarm?

I'm working in Windows and using VS2012. And over sure it's not the duplicate of this.

This is AddReminder Design Form. And the Code


Solution

  • best way to get the date from user is a control called dateTimePicker you can use it to get the input from user and very easily save it as a datetime variable also the database supports the datatime variable type so u can easily insert it with an sql insert query

    about how to know it's the alarm time ...there is a type of variable called timespan it can get the of subtraction or the diffrence bettwen 2 dates ...use this type with an if statment ... if timespan = 0 then it's time

    i know i didn't explan well but if u didn't get it i can show u some code