Пример #1
0
 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";
 }
Пример #2
0
 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";
 }
Пример #3
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     if (ConnectDAL.getConnect())
     {
         BLL.SANPHAM.xoaSanPham(txtMaSanPham.Text);
     }
     dgvSP.DataSource = ConnectDAL.loadtable("SELECT * FROM sanpham");;
 }
Пример #4
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     if (ConnectDAL.getConnect())
     {
         BLL.HOADON.xoaHoaDon(txtSoHD.Text);
     }
     dgvHD.DataSource = ConnectDAL.loadtable("SELECT * FROM hoadon");
 }
Пример #5
0
 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");
 }
Пример #6
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     if (ConnectDAL.getConnect())
     {
         BLL.NHACUNGCAP.xoaNhaCungCap(txtMaNCC.Text);
     }
     dgvNCC.DataSource = ConnectDAL.loadtable("SELECT * FROM nhacungcap");
 }
Пример #7
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     if (ConnectDAL.getConnect())
     {
         BLL.NHANVIEN.xoaNhanVien(txtMaNhanVien.Text);
     }
     dgvNV.DataSource = ConnectDAL.loadtable("SELECT * FROM nhanvien");
 }
Пример #8
0
 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");
 }
Пример #9
0
 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");
 }
Пример #10
0
 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";
 }
Пример #11
0
 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";
 }
Пример #12
0
 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());
     }
 }
Пример #13
0
        /// <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ụ...]";
        }
Пример #14
0
 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");
 }
Пример #15
0
 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");
 }
Пример #16
0
        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");
        }
Пример #17
0
 private void frmNhaCungCap_Load(object sender, EventArgs e)
 {
     dgvNCC.DataSource = ConnectDAL.loadtable("SELECT * FROM nhacungcap");
 }