Esempio n. 1
0
 private void Grid_Loaded(object sender, RoutedEventArgs e)
 {
     lsDanhSachSanPham.Items.Clear();
     lsSanPham = sp_BUS.DanhSachSanPham();
     foreach (var item in lsSanPham)
     {
         lsDanhSachSanPham.Items.Add(item);
     }
 }
Esempio n. 2
0
 private void LoadDanhSachSP()
 {
     lsDanhSachSanPham.Items.Clear();
     lsSanPham = sp_BUS.DanhSachSanPham();
     foreach (var item in lsSanPham)
     {
         lsDanhSachSanPham.Items.Add(item);
     }
 }
Esempio n. 3
0
        private void LoadDSSP()
        {
            lsDanhSachSanPham.Items.Clear();
            lsSanPham = sp_BUS.DanhSachSanPham();
            foreach (var item in lsSanPham)
            {
                lsDanhSachSanPham.Items.Add(item);
            }
            lsNhaSanXuat = nsx_BUS.DanhSachNhaSanXuat();
            lsLoaiDT     = loaidt_BUS.DanhSachLoaiDT();

            cboNhaSanXuat.ItemsSource = lsNhaSanXuat;
            cboLoaiDT.ItemsSource     = lsLoaiDT;
        }
Esempio n. 4
0
        private void LoadDanhSachDienThoai()
        {
            lvwSanPham.Items.Clear();
            _lsSanPham = _sp_BUS.DanhSachSanPham();
            foreach (var item in _lsSanPham)
            {
                lvwSanPham.Items.Add(item);
            }
            _lsNhaSanXuat = _nsx_BUS.DanhSachNhaSanXuat();
            _lsLoaiDT     = _loaiDT_BUS.DanhSachLoaiDT();

            cboNSX.ItemsSource    = _lsNhaSanXuat;
            cboLoaiDT.ItemsSource = _lsLoaiDT;
        }
Esempio n. 5
0
        private void LoadDSSP()
        {
            lsSanPham = sp_BUS.DanhSachSanPham();
            dgvQLSanPham.DataSource = lsSanPham;

            lsNhaSanXuat = nsx_BUS.DanhSachNhaSanXuat();
            lsLoaiDT     = loaidt_BUS.DanhSachLoaiDT();

            colNhaSanXuat.DataSource    = lsNhaSanXuat;
            colNhaSanXuat.DisplayMember = "TenNSX";
            colNhaSanXuat.ValueMember   = "MaNSX";

            colLoaiSanPham.DataSource    = lsLoaiDT;
            colLoaiSanPham.DisplayMember = "TenLoaiDT";
            colLoaiSanPham.ValueMember   = "MaLoaiDT";
        }
Esempio n. 6
0
        private void LoadDanhSachDienThoai()
        {
            _sp_BUS                = new clsSanPham_BUS();
            _lsSanPham             = _sp_BUS.DanhSachSanPham().FindAll(o => o.TrangThai == true); //Lay danh sach sp dang kinh doanh
            colTenSP.DataSource    = _lsSanPham;
            colTenSP.DisplayMember = "TenSP";
            colTenSP.ValueMember   = "MaSP";

            for (int i = 0; i < _lsSanPham.Count; i++)
            {
                ListViewItem lvi = new ListViewItem(_lsSanPham[i].TenSP);
                lvi.SubItems.Add(_lsSanPham[i].MaSP);
                if (File.Exists(_lsSanPham[i].HinhAnh))
                {
                    byte[]       byteHA = File.ReadAllBytes(_lsSanPham[i].HinhAnh);
                    MemoryStream ms     = new MemoryStream(byteHA);
                    Image        img    = Image.FromStream(ms);
                    imlSanPham.Images.Add(img);
                    //Thêm hình ảnh vào item
                    lvi.ImageIndex = imlSanPham.Images.Count - 1;
                }
                lvwSanPham.Items.Add(lvi);
            }
        }
Esempio n. 7
0
 private void LoadDanhSachSP()
 {
     lsSanPham = sp_BUS.DanhSachSanPham();
     dgvSanPhamTonKho.DataSource = lsSanPham;
 }