TimeSpan start = new TimeSpan(9, 0, 0); TimeSpan end = new TimeSpan(12, 0, 0); TimeSpan now = DateTime.Now.TimeOfDay; if ((now > start) && (now < end)) { }
private void btnLogin_Click(object sender, RoutedEventArgs e) { if (txtUsername.Text == "") { MessageBox.Show("Please enter Username", "Fill Field", MessageBoxButton.OK, MessageBoxImage.Information); txtUsername.Focus(); } else if (txtPassword.Password.ToString() == "") { MessageBox.Show("Please enter Password", "Fill Field", MessageBoxButton.OK, MessageBoxImage.Information); txtPassword.Focus(); } try { // dsb dsd = new dsb(); // dsd.Show(); // this.Close(); string uname, pwd; uname = txtUsername.Text; pwd = txtPassword.Password; DataSet ds = Globalvariables.Globals.select("select employee_id,privilege from add_user where username= '" + uname + "',password= '" + pwd + "'"); //DataRow drow; //string drowpass = ""; if (ds.Tables[0].Rows[0][0].ToString() == null || ds.Tables[0].Rows[0][0].ToString() == string.Empty) { Globals.set_sclose_employee_id(ds.Tables[0].Rows[0][0].ToString()); int y = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); Globals.SetGlobalInt(y); int z; if (ds.Tables[0].Rows[0][0].ToString() == null || ds.Tables[0].Rows[0][0].ToString() == string.Empty) { z = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); } else { z = 0; } TimeSpan start = new TimeSpan(9, 0, 0); TimeSpan end = new TimeSpan(12, 0, 0); TimeSpan now = DateTime.Now.TimeOfDay; if ((now > start) && (now < end)) { }
DataSet ds = Globalvariables.Globals.select("select employee_id,privilege from add_user where username= '" + uname + "',password= '" + pwd + "'");
' or 1 = 1;--
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)