示例#1
0
        private void danhSáchĐảngViênToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pictureBoxlogo.Visible       = false;
            labeltb1.Visible             = false;
            labeltb2.Visible             = false;
            labeltb3.Visible             = false;
            toolStripquanlyhoso.Visible  = true;
            comboBoxloc.Visible          = true;
            textBoxtimkiem.Visible       = true;
            buttontimkiem.Visible        = true;
            buttonendpre.Visible         = true;
            buttonpre.Visible            = true;
            buttonnext.Visible           = true;
            buttonendnext.Visible        = true;
            labeltongtrang.Visible       = true;
            textBoxsotrang.Visible       = true;
            tabControl1.Visible          = true;
            dataGridViewdanhsach.Visible = true;
            database db = new database();
            DataSet  ds = new DataSet();

            ds = db.laydanhsachdangvien();
            dataGridViewdanhsach.DataSource = ds.Tables[0];
            if (dataGridViewdanhsach.SelectedRows.Count > 0)
            {
            }
        }
示例#2
0
 private void toolStripButtonxoa_Click(object sender, EventArgs e)
 {
     if (dataGridViewdanhsach.SelectedRows.Count > 0)
     {
         if (MessageBox.Show(null, "Bạn có muốn xóa không!", "Cảnh Báo", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             database db = new database();
             db.xoadangvien(dataGridViewdanhsach.SelectedRows[0]);
             DataSet ds = new DataSet();
             ds = db.laydanhsachdangvien();
             dataGridViewdanhsach.DataSource = ds.Tables[0];
         }
     }
 }