private void frmNhanVien_Load(object sender, EventArgs e) { dgvNV.DataSource = ConnectDAL.loadtable("SELECT * FROM nhanvien"); comChucVu.DataSource = ConnectDAL.loadtable("SELECT * FROM chucvu"); comChucVu.DisplayMember = "TenCV"; comChucVu.ValueMember = "MaCV"; }
private void frmSanPham_Load(object sender, EventArgs e) { dgvSP.DataSource = ConnectDAL.loadtable("SELECT * FROM sanpham"); comNhaCungCap.DataSource = ConnectDAL.loadtable("SELECT * FROM sanpham"); comNhaCungCap.DisplayMember = "TenNCC"; comNhaCungCap.ValueMember = "MaNCC"; }
private void btnXoa_Click(object sender, EventArgs e) { if (ConnectDAL.getConnect()) { BLL.SANPHAM.xoaSanPham(txtMaSanPham.Text); } dgvSP.DataSource = ConnectDAL.loadtable("SELECT * FROM sanpham");; }
private void btnXoa_Click(object sender, EventArgs e) { if (ConnectDAL.getConnect()) { BLL.HOADON.xoaHoaDon(txtSoHD.Text); } dgvHD.DataSource = ConnectDAL.loadtable("SELECT * FROM hoadon"); }
private void btnSua_Click(object sender, EventArgs e) { if (ConnectDAL.getConnect()) { BLL.HOADON.suaHoaDon(txtSoHD.Text, comMaNV.SelectedValue.ToString(), comMaKH.SelectedValue.ToString(), txtNgayGiaoDich.Text); } dgvHD.DataSource = ConnectDAL.loadtable("SELECT * FROM hoadon"); }
private void btnXoa_Click(object sender, EventArgs e) { if (ConnectDAL.getConnect()) { BLL.NHACUNGCAP.xoaNhaCungCap(txtMaNCC.Text); } dgvNCC.DataSource = ConnectDAL.loadtable("SELECT * FROM nhacungcap"); }
private void btnXoa_Click(object sender, EventArgs e) { if (ConnectDAL.getConnect()) { BLL.NHANVIEN.xoaNhanVien(txtMaNhanVien.Text); } dgvNV.DataSource = ConnectDAL.loadtable("SELECT * FROM nhanvien"); }
private void btnSua_Click(object sender, EventArgs e) { if (ConnectDAL.getConnect()) { BLL.SANPHAM.suaSanPham(txtMaSanPham.Text, txtTenSanPham.Text, comNhaCungCap.SelectedValue.ToString(), txtSoLuong.Text, txtDVT.Text, txtGiaSP.Text); } dgvSP.DataSource = ConnectDAL.loadtable("SELECT * FROM sanpham"); }
private void btnSua_Click(object sender, EventArgs e) { if (ConnectDAL.getConnect()) { BLL.NHACUNGCAP.suaNhaCungCap(txtMaNCC.Text, txtTenNCC.Text, txtDiaChi.Text, txtDienThoai.Text); } dgvNCC.DataSource = ConnectDAL.loadtable("SELECT * FROM nhacungcap"); }
private void frmHoaDon_Load(object sender, EventArgs e) { dgvHD.DataSource = ConnectDAL.loadtable("SELECT * FROM hoadon"); comMaNV.DataSource = ConnectDAL.loadtable("SELECT * FROM nhanvien"); comMaNV.DisplayMember = "TenNV"; comMaNV.ValueMember = "MaNV"; comMaKH.DataSource = ConnectDAL.loadtable("SELECT * FROM khachhang"); comMaKH.DisplayMember = "TenKH"; comMaKH.ValueMember = "MaKH"; }
private void frmDoanhThu_Load(object sender, EventArgs e) { dgvDT.DataSource = ConnectDAL.loadtable("SELECT * FROM doanhthu"); comSoHD.DataSource = ConnectDAL.loadtable("SELECT * FROM hoadon"); comSoHD.DisplayMember = "SoDH"; comSoHD.ValueMember = "SoHD"; comMaSP.DataSource = ConnectDAL.loadtable("SELECT * FROM sanpham"); comMaSP.DisplayMember = "TenSP"; comMaSP.ValueMember = "MaSP"; }
private void comChucVu_SelectedIndexChanged(object sender, EventArgs e) { if ((comChucVu.SelectedIndex == -1) || (comChucVu.Text == "")) { dgvTK.DataSource = ConnectDAL.loadtable("SELECT * FROM nhanvien"); } else { dgvTK.DataSource = ConnectDAL.loadtable("SELECT * FROM nhanvien WHERE MaCV='" + MaCV + "'", comChucVu.SelectedValue.ToString()); } }
/// <summary> /// ham tra ve toan bo nhan vien private void frmTimKiem_Load(object sender, EventArgs e) { bindNhanVien = new BindingSource(); bindNhanVien.DataSource = ConnectDAL.loadtable("SELECT * FROM nhanvien"); dgvTK.DataSource = ConnectDAL.loadtable("SELECT * FROM nhanvien"); comChucVu.DataSource = ConnectDAL.loadtable("SELECT * FROM chucvu"); comChucVu.DisplayMember = "TenCV"; comChucVu.ValueMember = "MaCV"; comChucVu.SelectedIndex = -1; comChucVu.Text = "[Chọn chức vụ...]"; }
private void btnXoa_Click(object sender, EventArgs e) { if (ConnectDAL.getConnect()) { try { BLL.DOANHTHU.xoaDoanhThu(comSoHD.SelectedValue.ToString(), comMaSP.SelectedValue.ToString()); } catch (Exception) { MessageBox.Show("Thong tin sai !"); } } dgvDT.DataSource = ConnectDAL.loadtable("SELECT * FROM doanhthu"); }
private void btnSua_Click(object sender, EventArgs e) { if (ConnectDAL.getConnect()) { try { BLL.DOANHTHU.suaDoanhThu(comSoHD.SelectedValue.ToString(), comMaSP.SelectedValue.ToString(), txtGiaSP.Text, txtSoLuong.Text, txtChietKhau.Text, txtThanhTien.Text); } catch (Exception) { MessageBox.Show("Thong tin sai !"); } } dgvDT.DataSource = ConnectDAL.loadtable("SELECT * FROM doanhthu"); }
private void btnSua_Click(object sender, EventArgs e) { bool GT = true; if (radNam.Checked) { GT = true; } else { GT = false; } if (ConnectDAL.getConnect()) { BLL.NHANVIEN.suaNhanVien(txtMaNhanVien.Text, txtHoNhanVien.Text, txtTenNhanVien.Text, GT, txtSoChungMinh.Text, txtDiaChi.Text, txtDienThoai.Text, comChucVu.SelectedValue.ToString(), txtLuongCoBan.Text); } dgvNV.DataSource = ConnectDAL.loadtable("SELECT * FROM nhanvien"); }
private void frmNhaCungCap_Load(object sender, EventArgs e) { dgvNCC.DataSource = ConnectDAL.loadtable("SELECT * FROM nhacungcap"); }