예제 #1
0
 private void btnLuuNCC_Click(object sender, EventArgs e)
 {
     if (add)
     {
         if (MessageBox.Show("Bạn có muốn lưu?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             string maNCC     = txtMaNCC.Text;
             string tenNCC    = txtTenNCC.Text;
             string diaChiNCC = txtDiaChi.Text;
             string sdtNCC    = txtSDT.Text;
             string maLoai    = cboMaLoai.SelectedValue.ToString();
             ncc_bll.them1NhaCungCap(maNCC, tenNCC, diaChiNCC, sdtNCC, maLoai);
             MessageBox.Show("Thành Công!");
             frmQuanLy_Load(sender, e);
         }
     }
     if (update)
     {
         if (MessageBox.Show("Bạn có muốn sửa?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             string maNCC     = txtMaNCC.Text;
             string tenNCC    = txtTenNCC.Text;
             string diaChiNCC = txtDiaChi.Text;
             string sdtNCC    = txtSDT.Text;
             string maLoai    = cboMaLoai.SelectedValue.ToString();
             ncc_bll.sua1NhaCungCap(maNCC, tenNCC, diaChiNCC, sdtNCC, maLoai);
             MessageBox.Show("Thành Công!");
             frmQuanLy_Load(sender, e);
         }
     }
 }