示例#1
0
        private void back_Click(object sender, EventArgs e)
        {
            ManagerIn i = new ManagerIn(UserName, Password);

            i.Show();
            this.Hide();
        }
示例#2
0
        private void logIn_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(@"Server=.\SQLEXPRESS;Database=labormgt;Integrated Security=true");

            conn.Open();
            string query = "";

            query = "Select * FROM manager WHERE UserName='******' and Password='******' ";
            SqlDataAdapter ss   = new SqlDataAdapter(query, conn);
            DataTable      dtbl = new DataTable();

            ss.Fill(dtbl);
            if (dtbl.Rows.Count == 1)
            {
                MessageBox.Show("Successfully LogedIn!!!", "Message");
                ManagerIn i = new ManagerIn();
                this.Hide();
                i.Show();
            }
            else
            {
                MessageBox.Show("Error!!!", "Message");
            }
            conn.Close();
        }