Beispiel #1
0
        void NhapKho(HoaDonNhap_DTO hd_nhap)
        {
            HienThiHoaDonNhap_BUS        hthdnhap_bus = new HienThiHoaDonNhap_BUS();
            List <HienThiHoaDonNhap_DTO> listHTHD     = hthdnhap_bus.LayDanhSachTheoIDHoaDonNhap(hd_nhap.id);
            BangSize_BUS size_bus = new BangSize_BUS();

            foreach (HienThiHoaDonNhap_DTO item in listHTHD)
            {
                size_bus.CapNhatKho(item.idGiay, item.size, item.soLuong, item.donGia);
            }

            HoaDonNhap_BUS hd_bus = new HoaDonNhap_BUS();

            if (hd_bus.NhapKho(hd_nhap.id, int.Parse(txtTongTien.Text)))
            {
                LoadHDNhap();
                MessageBox.Show("Thanh Toán Thành Công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            txtMaNCC.Enabled     = true;
            btnHuyHoaDon.Enabled = false;
            btnNhapKho.Enabled   = false;
        }
Beispiel #2
0
        void HienThiCTHoaDonNhap(int idHoaDonNhap)
        {
            lvHoaDon.Items.Clear();
            HoaDonNhap_BUS               hdnhap_bus   = new HoaDonNhap_BUS();
            HienThiHoaDonNhap_BUS        hthdnhap_bus = new HienThiHoaDonNhap_BUS();
            List <HienThiHoaDonNhap_DTO> listHTHD     = new List <HienThiHoaDonNhap_DTO>();

            listHTHD = hthdnhap_bus.LayDanhSachTheoIDHoaDonNhap(idHoaDonNhap);

            int tongTien = 0;

            foreach (HienThiHoaDonNhap_DTO item in listHTHD)
            {
                ListViewItem lvItem = new ListViewItem(item.tenGiay);
                lvItem.SubItems.Add(item.size);
                lvItem.SubItems.Add(item.soLuong.ToString());
                lvItem.SubItems.Add(item.donGia.ToString());
                lvItem.SubItems.Add(item.thanhTien.ToString());
                tongTien = tongTien + item.thanhTien;
                lvHoaDon.Items.Add(lvItem);
            }
            txtTongTien.Text = tongTien.ToString();
            hdnhap_bus.CapNhatTien(idHoaDonNhap, tongTien);
        }