示例#1
0
        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();
            }
        }