예제 #1
0
 private void btnLuu_NCC_Click(object sender, EventArgs e)
 {
     ENTITY.NhaCungCap ncc = new ENTITY.NhaCungCap(txtMaNCC.Text.Trim(), txtTenNCC.Text.Trim(), txtSDTNCC.Text.Trim());
     DATA.AddNCC       c   = new DATA.AddNCC();
     c.addNCC(ncc);
     loadDataGirdView();
     LockControl();
 }
예제 #2
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            DialogResult check = MessageBox.Show("Bạn có muốn xóa không", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (check == DialogResult.Yes)
            {
                ENTITY.NhaCungCap n = new ENTITY.NhaCungCap();
                n.ID_NhaCungCap = txtID_NhaCungCap.Text.Trim();
                DAL.NhaCungCap_Model ncc = new DAL.NhaCungCap_Model();
                ncc.deleteNhaCungCap(n);
            }
            showLsvNhaCungCap();
            lockControl();
            clearControl();
        }
예제 #3
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     ENTITY.NhaCungCap n = new ENTITY.NhaCungCap();
     n.ID_NhaCungCap = txtID_NhaCungCap.Text.Trim();
     n.TenNCC        = txtTenNCC.Text.Trim();
     n.DiaChi        = txtDiaChi.Text.Trim();
     n.SDT           = txtSDT.Text.Trim();
     n.Email         = txtEmail.Text.Trim();
     n.Website       = txtWebsite.Text.Trim();
     DAL.NhaCungCap_Model ncc = new DAL.NhaCungCap_Model();
     if (kt == true)
     {
         ncc.insertNhaCungCap(n);
     }
     else
     {
         ncc.editNhaCungCap(n);
     }
     showLsvNhaCungCap();
     lockControl();
     clearControl();
 }