Hỏi đáp

Chia sẻ kiến thức, cùng nhau phát triển

LAP TRINH C# TẠO PHAN MEM QUAN LY QUAN CAFE

6 năm trước 445 lượt xem 2 bình luận 6 năm trước

void ShowBill(int id) { lsvBill.Items.Clear(); List<QuanLyQuanCafe.DTO.Menu> listBillInfo = MenuDAO.Instance.GetListMenuByTable(id); foreach (QuanLyQuanCafe.DTO.Menu item in listBillInfo) { ListViewItem lsvItem = new ListViewItem(item.FoodName.ToString()); lsvItem.SubItems.Add(item.Count.ToString()); lsvItem.SubItems.Add(item.Price.ToString()); lsvItem.SubItems.Add(item.TotalPrice.ToString()); lsvBill.Items.Add(lsvItem); } }

LỔI: 

lsvBill.Items.Clear();

..................

lsvBill.Items.Add(lsvItem);

PHÁT HIỆN LỔI:

Severity    Code    Description    Project    File    Line    Suppression State
Error    CS0103    The name 'lsvBill' does not exist in the current context    QuanLyQuanCafe   fTableManager.cs    52    Active
Error    CS0103    The name 'lsvBill' does not exist in the current context    QuanLyQuanCafe   fTableManager.cs    62    Active

MONG AD GIUP SỮA LẠI GIÚP!

Bình luận

Để bình luận, bạn cần đăng nhập bằng tài khoản Howkteam.

Đăng nhập
Quang NV đã bình luận 6 năm trước

Tạo cái listView vs tên là lsvBill chưa

nguyenthanhdanh55162 đã bình luận 6 năm trước

Bạn cần xem lại biến 'lsvBill' của bạn nha, mình thấy trong cái hàm ShowBill thì bạn chưa khai biến đó.

Bài viết
0
Câu hỏi
1
Bình luận
0