Ejemplo n.º 1
0
        private void Building_btn_Click(object sender, EventArgs e)
        {
            Building_Present_pnl.Visible = true;
            Building_Present_pnl.BringToFront();
            panelPos.Height        = Building_btn.Height - 5;
            panelPos.Top           = Building_btn.Top + 2;
            Home_pnl.Visible       = false;
            Event_pnl.Visible      = false;
            About_Us_pnl.Visible   = false;
            Student_pnl.Visible    = false;
            Statistics_pnl.Visible = false;
            Student_Present_pnl.BringToFront();
            Student_Present_pnl.Visible = true;
            Buidling_pnl.Visible        = true;
            Add_Edit_pnl.Visible        = false;
            //===================================
            flowLayoutPanel1.Visible = true;

            flowLayoutPanel1.Controls.Clear();

            SqlCommand sqlcommand = new SqlCommand();

            sqlcommand.CommandType = System.Data.CommandType.Text;
            sqlcommand.CommandText = "select * from ToaNha";

            /*
             * if (conn == null)
             * {
             *  conn = new SqlConnection(strconnection);
             *  conn.Open();
             * }*/
            connection.Open();
            sqlcommand.Connection = connection;

            SqlDataReader sqlReader = sqlcommand.ExecuteReader();

            while (sqlReader.Read())
            {
                Label l = addLale1(sqlReader.GetString(0));
                flowLayoutPanel1.Controls.Add(l);
                l.DoubleClick += new System.EventHandler(this.labelDoubleClick);
            }
            sqlReader.Close();
            connection.Close();
        }
Ejemplo n.º 2
0
 private void Add_Back_Pic_Click(object sender, EventArgs e)
 {
     Student_Present_pnl.BringToFront();
     Student_Present_pnl.Visible = true;
 }