TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Goran Bibic
478
2.9k
200.8k
Case when if is time sequence 5 minutes from sql c#
Apr 4 2018 5:55 AM
If worker come to company 5 minutes and
if
(Int32.Parse(queryString) != 0)
{
//provjeravamo da li se radnik mozda prijavio prije 5 minuta, samim tim nema pravo na odjavu a ni na novu prijavu
string commanda =
"SELECT CASE WHEN (SELECT FLOOR(TIME_TO_SEC(TIMEDIFF(now(),max(VrijemeDolaska)))/60) from prijava_radnika where IdPosjetioc="
+ osobaId +
") < 5 THEN 1 ELSE 0 END;"
;
//MessageBox.Show(commanda);
int
broj = Int32.Parse.Execute(commanda));
commanda =
"SELECT CASE WHEN (SELECT FLOOR(TIME_TO_SEC(TIMEDIFF(now(),max(VrijemeOdlaska)))/60) from prijava_radnika where IdPosjetioc="
+ osobaId +
") < 5 THEN 1 ELSE 0 END;"
;
int
broj2 =
Int32.Parse.Execute(commanda));
//MessageBox.Show(broj.ToString());
if
(broj == 1 || broj2 == 1)
{
notificationPanel.BackColor = System.Drawing.ColorTranslator.FromHtml(
"#FD7400"
);
messageLabel.Text =
"Prijava i odjava su blokirani 5 minuta \nza ovog radnika"
;
textBox1.Text =
""
;
}
else
{ //rest code of app....
Reply
Answers (
26
)
How to call the javascript function in c#
use of unassigned local variable error