Пример #1
0
 private void btn_Commande_Click(object sender, EventArgs e)
 {
     btn_Commande.BackColor   = blueC;
     button1.BackColor        = bluee;
     btn_Historique.BackColor = bluee;
     btn_Profil.BackColor     = bluee;
     commander = new commander();
     pnl.Controls.Clear();
     pnl.Controls.Add(commander);
 }
Пример #2
0
        private void Form2_Load(object sender, EventArgs e)
        {
            lbl_Nom.Text = User;
            if (lbl_Nom.Text == "tokismos")
            {
                lbl_Nom.Visible     = false;
                lbl_Credit.Visible  = false;
                label4.Visible      = true;
                label2.Visible      = false;
                btn_Panier.Visible  = false;
                pictureBox4.Visible = false;
                btn_Profil.Location = new Point(0, 244);
                pnl.Controls.Clear();
                pnl.Controls.Add(admP);
                button1.Visible        = true;
                btn_Commande.Visible   = false;
                btn_Historique.Visible = false;
            }
            else
            {
                commander = new commander();
                pnl.Controls.Clear();
                pnl.Controls.Add(commander);
            }

            MySqlConnection cnn = new MySqlConnection("Server=localhost;DATABASE=food;Uid=admin;Password=123;");

            MySqlCommand     cmd = new MySqlCommand("Select Credit from compte WHERE UserN ='" + User + "'", cnn);
            MySqlDataAdapter da  = new MySqlDataAdapter(cmd);
            DataTable        dt  = new DataTable();

            da.Fill(dt);
            if (dt.Rows.Count == 1)
            {
                String Cred = dt.Rows[0]["Credit"].ToString();
                Cre = Cred;
            }
            lbl_Credit.Text = Cre.ToString();
        }
Пример #3
0
 private void button11_Click(object sender, EventArgs e)
 {
     commander2 = new commander();
     pnl.Controls.Add(commander2);
 }