private void pictureBox1_Click(object sender, EventArgs e) { order ordr = new order(myName); ordr.Show(); myLogin lgnref = new myLogin(); string name = lgnref.Get_login_username(); //Console.WriteLine(name); }
public Options(string bannerName) { InitializeComponent(); UserBanner.Text = bannerName; myName = giveName(bannerName); //string SelectAdmin = "Admin"; myLogin lgn = new myLogin(); string OptionsUserName = lgn.Get_login_username(); MySqlConnection connect = new MySqlConnection("server = localhost; database = mega; username = root; password=;"); string query = "select* from LoginPage where username = '******' "; MySqlDataAdapter data = new MySqlDataAdapter(query, connect); DataTable DT = new DataTable(); data.Fill(DT); if (DT.Rows[0][3].ToString().Trim() == "Admin") { ManagePicture.Show(); ManageLabel.Show(); } else { ManagePicture.Hide(); ManageLabel.Hide(); } }