Sahaya Cecil

Sahaya Cecil

  • NA
  • 14
  • 962

Attendance Management system project

Sep 21 2016 5:42 AM
I have an employee name textbox and a login button when i click on login buton for a user only once the current date with empname should be stored in SQL SERVER I NEED THE LOGIC
 
private void btn_itLogin_Click(object sender, EventArgs e)
{
//if(txt_iwdEname.Text!="")
// {
//DateTime dt = new DateTime();
//dt = DateTime.Now;
selectQueryString = "insert into tb_empInTime(Emname,Empindate,Empintime) values('" +
txt_iwdEname.Text + "','" + DateTime.Now + "','"+DateTime.Now+"')";
ExecQuery();
MessageBox.Show("You have Logged in \n Have a nice day", txt_iwdEname.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
// }
}
else
{
MessageBox.Show("You have already logged in", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
 
By this code i am getting a user login info multiple times per day i need only once 
 

Answers (2)