private void btnThem_Click(object sender, EventArgs e) { if (txtTenHieuXe.Text != "") { try { HieuXe hx = new HieuXe() { TenHieuXe = txtTenHieuXe.Text }; HieuXeBUS.HieuXe_Insert(hx); MessageBox.Show("Thêm thành công"); dgvDanhSachHieuXe.DataSource = HieuXeBUS.HieuXe_GetHieuXe(); txtTenHieuXe.Text = null; } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("Chưa nhập tên hiệu xe!", "Lỗi!!!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } btnXoa.Enabled = false; }
private void frmTimKiem_Load(object sender, EventArgs e) { cbHieuXe.DataSource = HieuXeBUS.HieuXe_GetHieuXe(); cbHieuXe.DisplayMember = "HieuXe"; cbHieuXe.ValueMember = "HieuXe"; cb_TimKiem.DataSource = XeBUS.Xe_DanhSach(); cb_TimKiem.DisplayMember = "TenChuXe"; cb_TimKiem.ValueMember = "TenChuXe"; SQLDataProvider.connection.Close(); }
private void btnXoa_Click(object sender, EventArgs e) { try { HieuXe hx = new HieuXe() { TenHieuXe = txtTenHieuXe.Text }; HieuXeBUS.HieuXe_Delete(hx); MessageBox.Show("Xóa thành công"); dgvDanhSachHieuXe.DataSource = HieuXeBUS.HieuXe_GetHieuXe(); } catch (Exception ex) { MessageBox.Show(ex.Message); } btnXoa.Enabled = false; txtTenHieuXe.Text = ""; }
private void frmTiepnhanxe_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'quanlygaraoto1.sp_Xe_DanhSach' table. You can move, or remove it, as needed. this.sp_Xe_DanhSachTableAdapter.Fill(this.quanlygaraoto1.sp_Xe_DanhSach); try { cbHieuXe.DataSource = HieuXeBUS.HieuXe_GetHieuXe(); cbHieuXe.DisplayMember = "HieuXe"; cbHieuXe.ValueMember = "HieuXe"; LoadDSXeSuaTrongNgay(dateNgayTiepNhan.Text); sp_Xe_DanhSachTableAdapter.Fill(quanlygaraoto1.sp_Xe_DanhSach); tableTiepNhanXe.DataSource = XeBUS.Xe_DanhSach(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { SQLDataProvider.connection.Close(); } }
private void frmHieuXe_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'quanlygaraoto1.sp_HieuXe_GetHieuXe' table. You can move, or remove it, as needed. this.sp_HieuXe_GetHieuXeTableAdapter.Fill(this.quanlygaraoto.sp_HieuXe_GetHieuXe); dgvDanhSachHieuXe.DataSource = HieuXeBUS.HieuXe_GetHieuXe(); }
private void rbt_HieuXe_CheckedChanged(object sender, EventArgs e) { cb_TimKiem.DataSource = HieuXeBUS.HieuXe_GetHieuXe(); cb_TimKiem.DisplayMember = "HieuXe"; cb_TimKiem.ValueMember = "HieuXe"; }