public void loadKhuyenMai() { List <DTO_KhuyenMai> khuyenMais = new List <DTO_KhuyenMai>(); foreach (DataRow row in busKhuyenMai.getAllKhuyenMai().Rows) { DTO_KhuyenMai km = new DTO_KhuyenMai(); km.maKhuyenMai = row["MAKHUYENMAI"].ToString(); km.tenSuKien = row["TENSUKIEN"].ToString() + " -" + row["PHANTRAMGIAMGIA"].ToString() + "%"; khuyenMais.Add(km); } cbbKhuyenMai.DataSource = khuyenMais; cbbKhuyenMai.DisplayMember = "tenSuKien"; }
public void loadDataKhuyenMai() { lvwKhuyenMai.Clear(); lvwKhuyenMai.Columns.Add("STT", 100); lvwKhuyenMai.Columns.Add("Mã khuyến mãi", 100); lvwKhuyenMai.Columns.Add("Tên sự kiện", 100); lvwKhuyenMai.Columns.Add("Giảm giá (%)", 100); lvwKhuyenMai.FullRowSelect = true; lvwKhuyenMai.View = View.Details; int stt = 0; foreach (DataRow row in busKhuyenMai.getAllKhuyenMai().Rows) { stt++; ListViewItem item = new ListViewItem(stt.ToString()); item.SubItems.Add(row[1].ToString()); item.SubItems.Add(row[2].ToString()); item.SubItems.Add(row[3].ToString()); lvwKhuyenMai.Items.Add(item); } }