Example #1
0
        private void frmNhacc_Load(object sender, EventArgs e)
        {
            NhaccBUL cls = new NhaccBUL();

            dataGridView1.DataSource = cls.Danhsachnhacungcap();
            dataGridView1.AutoResizeColumns();
        }
Example #2
0
 private void btnInsert_Click(object sender, EventArgs e)
 {
     try
     {
         NhaccBUL    cls = new NhaccBUL();
         NhaccPublic p   = new NhaccPublic();
         p.Mancc  = txtMancc.Text;
         p.Tenncc = txtTenncc.Text;
         p.Dchi   = txtDchi.Text;
         p.Dthoai = txtDthoai.Text;
         cls.Themnhacc(p);
         frmNhacc_Load(sender, e);
     }
     catch (SqlException)
     {
         MessageBox.Show("Lỗi không thêm được Nhà cung cấp");
     }
 }