Beispiel #1
0
        private void Back_Click(object sender, EventArgs e)
        {
            Manager_Function mf = new Manager_Function();

            this.Hide();
            mf.Show();
        }
Beispiel #2
0
        private void ok_Click(object sender, EventArgs e)
        {
            string          Connection = "datasource = localhost; username = root; password =; database = tiny_library";
            MySqlConnection DBconnect  = new MySqlConnection(Connection);

            DBconnect.Open();
            if (Flag == 0)
            {
                MySqlDataAdapter ad1 = new MySqlDataAdapter("Select * From login where UserName = '******'and Password = '******' ", DBconnect);
                DataTable        dt  = new DataTable();
                ad1.Fill(dt);
                if (dt.Rows.Count == 1)
                {
                    Admin_Manager_Create ad_mg = new Admin_Manager_Create();
                    DBconnect.Close();
                    this.Hide();
                    ad_mg.Show();
                }
                else
                {
                    MessageBox.Show("Incorrect Username or Password");
                }
            }
            else if (Flag == 1)
            {
                MySqlDataAdapter ad1 = new MySqlDataAdapter("Select * From managerlogin where MUserName = '******'and MPassword = '******' ", DBconnect);
                MySqlCommand     mc  = new MySqlCommand();
                DataTable        dt  = new DataTable();
                ad1.Fill(dt);
                if (dt.Rows.Count == 1)
                {
                    Manager_Function mf = new Manager_Function();
                    this.Hide();
                    mf.Show();
                }
                else
                {
                    MessageBox.Show("Incorrect Username or Password");
                }
            }
        }