private void LoadComboboxNhaSanXuat() { BLL.NhaSanXuatBLL nsx = new BLL.NhaSanXuatBLL(); cbbMaNhaSanXuatSP.DataSource = nsx.LoadCbbManager(); cbbMaNhaSanXuatSP.ValueMember = "MASX"; cbbMaNhaSanXuatSP.DisplayMember = "TENNSX"; }
private void btnXoaNSX_Click(object sender, EventArgs e) { if (txtMaNhaSanXuatNSX.Text != "") { BLL.NhaSanXuatBLL nhaSanXuat = new BLL.NhaSanXuatBLL(); if (nhaSanXuat.Delete(txtMaNhaSanXuatNSX.Text) == true) { MessageBox.Show("Xóa thành công nhà sản xuất " + txtMaNhaSanXuatNSX.Text, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); LamMoiNhaSanXuat(); LoadNSX(); LoadComboboxNhaSanXuat(); } else { MessageBox.Show("Lỗi xảy ra trong quá trình thực hiện", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Kiểm tra thông tin mã nhà sản xuất chưa được nhập!!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void btnCapNhatNSX_Click(object sender, EventArgs e) { BLL.NhaSanXuatBLL nhaSanXuat = new BLL.NhaSanXuatBLL(); if (txtMaNhaSanXuatNSX.Text != "" && txtTenNhaSanXuatNSX.Text != "" && cbbQuocGiaNSX.Text != "") { if (nhaSanXuat.Update(txtMaNhaSanXuatNSX.Text, txtTenNhaSanXuatNSX.Text, cbbQuocGiaNSX.Text) == true) { MessageBox.Show("Cập nhật thành công "); LamMoiNhaSanXuat(); LoadNSX(); LoadComboboxNhaSanXuat(); } else { MessageBox.Show("Lỗi trong quá trình thực hiện"); } } else { MessageBox.Show("Nhập đầy đủ thông tin trước khi cập nhật"); } }
private void btnThemNSX_Click(object sender, EventArgs e) { if (txtMaNhaSanXuatNSX.Text != "" && txtTenNhaSanXuatNSX.Text != "" && cbbQuocGiaNSX.Text != "") { BLL.NhaSanXuatBLL nhaSanXuat = new BLL.NhaSanXuatBLL(); if (nhaSanXuat.Insert(txtMaNhaSanXuatNSX.Text, txtTenNhaSanXuatNSX.Text, cbbQuocGiaNSX.Text) == true) { MessageBox.Show("Thêm nhà sản xuất thành công ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); LamMoiNhaSanXuat(); LoadNSX(); LoadComboboxNhaSanXuat(); } else { MessageBox.Show("Lỗi xảy ra trong quá trình thực hiện", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Nhập đầy đủ thông tin nhà sản xuất trước khi thêm !!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void LoadNSX() { BLL.NhaSanXuatBLL nsx = new BLL.NhaSanXuatBLL(); dgvNSX.DataSource = nsx.Load(); }