Example #1
0
 private void buttonIsertLoai_Click(object sender, EventArgs e)
 {
     try
     {
         if (IvaildNhom())
         {
             loaiNguoiDung_Quyen loainguoidung_quyen = new loaiNguoiDung_Quyen {
                 loaiNguoiDung_id = Convert.ToInt32(comboBoxLoaiNguoiDung.SelectedValue), quyen_id = Convert.ToInt32(comboBoxNhomQuyen.SelectedValue)
             };
             if (loainguoidung_quyen.insert())
             {
                 loaddata();
             }
             else
             {
             }
         }
         else
         {
             MessageBox.Show("ban chua dien du thong tin");
         }
     }
     catch (SqlException ex)
     {
         MessageBox.Show("Lỗi SQL exception !\n" + ex.Message);
     }
 }
Example #2
0
        public void loaddata()
        {
            nguoiDung_Quyen     n = new nguoiDung_Quyen();
            loaiNguoiDung_Quyen l = new loaiNguoiDung_Quyen();

            dataGridView1.DataSource = n.ShowtableNguoiDung_Quyen();
            dataGridView2.DataSource = l.ShowtableLoaiNguoiDung_Quyen();
        }