private void endToolStripMenuItem_Click(object sender, EventArgs e) { Cashdraw_Close cr = new Cashdraw_Close(); cr.Date = txtdate.Text; cr.ShowDialog(); }
private void Authenticate() { if (txtusername.Text != "" && txtpassword.Text != "") { query = "select * from Shift where Date<>'" + txtdate.Text + "' and Status<>'" + "Closed" + "'"; tb = db.Search(query); if (tb.Rows.Count > 0) { Cashdraw_Close cr = new Cashdraw_Close(); cr.Date = tb.Rows[0][0].ToString(); cr.ShowDialog(); Authenticate(); } else { query = "select Active, Role from Login where Username='******' and Password='******' and Active='" + db.Encrypt("1") + "'"; tb = db.Search(query); if (tb.Rows.Count > 0) { Main_Menu mm = new Main_Menu(); string[] info = { txtdate.Text, txtusername.Text }; mm.Info = info; mm.Show(); this.Hide(); } else { MessageBox.Show("Invalid Entry", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } else { MessageBox.Show("Invalid Entry", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }