Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If DateTime.Now.ToString("dddd") = "Sun" Then
Label1.Text = "Sun"
ElseIf DateTime.Now.ToString("dddd") = "Mon" Then
Label1.Text = "Mon"
ElseIf DateTime.Now.ToString("dddd") = "Tue" Then
Label1.Text = "Tue"
ElseIf DateTime.Now.ToString("dddd") = "Wed" Then
Label1.Text = "Wed"
ElseIf DateTime.Now.ToString("dddd") = "Thu" Then
Label1.Text = "Thu"
ElseIf DateTime.Now.ToString("dddd") = "Fri" Then
Label1.Text = "Fri"
ElseIf DateTime.Now.ToString("dddd") = "Sat" Then
Label1.Text = "Sat"
Else
Label1.Text = Nothing
End If
End Sub
But after 23:59:59, label1.text doesn't change to the next day.
any suggestions ?
Is there anything more to go in than 2 schedules eg.
Normal, 09.00, 10.00, 11.00 etc.
Friday, 09.10, 10.00, 11.00 etc. ?
If not I'm not sure I'd even bother with a database. A simple text file would be more than adequate (and easily edited) with the advantage that you have complete control over the formatting.
Is there anything more to go in than 2 schedules eg.
Normal, 09.00, 10.00, 11.00 etc.
Friday, 09.10, 10.00, 11.00 etc. ?
If not I'm not sure I'd even bother with a database. A simple text file would be more than adequate (and easily edited) with the advantage that you have complete control over the formatting.
It is not that simple, there is 4 or 5 groups of bell times
Or maybe you are right, like this:
if time = 09:00 page group 1 (with class 1>6)
if time = 09:30 page group 2 (with class 6>10 and outside)
It is not that simple, there is 4 or 5 groups of bell times
Or maybe you are right, like this:
if time = 09:00 page group 1 (with class 1>6)
if time = 09:30 page group 2 (with class 6>10 and outside)
What I would do is create an Access database that has 2 columns: Integer (for the day of the week; Sunday is 0, Saturday is 6), Text (to hold the time, I would recommend the time portion use 24 hour time to make things easier). Then I would fill it with each of the day's times the "bell" should ring. For example if the bell rings at 8am M-F, 9am M, W, F and so on there would be these records in the table:
1,08:00
1,09:00
2,08:00
3,08:00
3,09:00
4,08:00
5,08:00
5,09:00
Then when you query that table to get the times for that particular day, just pass it the DateTime.Now.DayOfWeek (which is an integer) and you'll get the times for that day.
Then it's just a matter of having a timer (tick interval set to 5000 (5 seconds)) and check the time against your list of times, if it matches one of them, then "ring" the bell.
By using a database, you can more easily incorporate a form that lets you change that "schedule" in the database, you could even include 2 date fields to have different schedules for date ranges (summer classes vs fall classes) and so on.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
What I would do is create an Access database that has 2 columns: Integer (for the day of the week; Sunday is 0, Saturday is 6), Text (to hold the time, I would recommend the time portion use 24 hour time to make things easier). Then I would fill it with each of the day's times the "bell" should ring. For example if the bell rings at 8am M-F, 9am M, W, F and so on there would be these records in the table:
1,08:00
1,09:00
2,08:00
3,08:00
3,09:00
4,08:00
5,08:00
5,09:00
Then when you query that table to get the times for that particular day, just pass it the DateTime.Now.DayOfWeek (which is an integer) and you'll get the times for that day.
Then it's just a matter of having a timer (tick interval set to 5000 (5 seconds)) and check the time against your list of times, if it matches one of them, then "ring" the bell.
By using a database, you can more easily incorporate a form that lets you change that "schedule" in the database, you could even include 2 date fields to have different schedules for date ranges (summer classes vs fall classes) and so on.
That is a good idea, but I don't know enough VB.NET A. to call 2 columns in a database, B. I have the following command :
where "labelDialingNumber.Text" is the label with a group to "RING-A-BELL"
so before the "1,09:00" bell(before every bell, but i took this as e.g.) the "labelDialingNumber.text" needs to change to that bell...
where "labelDialingNumber.Text" is the label with a group to "RING-A-BELL"
so before the "1,09:00" bell(before every bell, but i took this as e.g.) the "labelDialingNumber.text" needs to change to that bell...
Here's an example of what I was talking about with using a database for this. I used an Access 2003 database (you can use Access 2010 to edit it, just keep it in the 2002/2003 database format) to hold the data in a single table. I did my best to cover all the basics to it, you'll probably want a different edit form though, but mine at least works to get the point across.
Also it doesn't take into account where to put the database if you deploy the app (I usually have the app copy the database from the same directory into the current user's appdata folder).
Also, you'll have to plug in the code you have that actually "rings" the bell too, the app right now just displays a messagebox to indicate when the ringing happens.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
Hi,
This is small and simple, I love it !
The hard part is to connect it with Asterisk PBX
The code that I'm working on is a modified softphone that I found...
There is a lot of files, dll's and "Imports"
You can't import something that the IDE's never heard of!
THANKS !
In the next couple days I won't have a lot of time building this pet project (school is starting soon, and I have a lot of work ahead...)
I'll check back in a few days with an update...