コード例 #1
0
        private void ThemHoaDon_Load(object sender, EventArgs e)
        {
            //hide bang? mota
            pnlMoTa.Visible = false;

            listSanPham = requestData.GetListSanPham();

            //lbkhuyenmai
            lbKhuyenMai.Text = khuyenMai.ToString() + " %";
            lbTongTien.Text  = "0 VNĐ";
            lbThanhTien.Text = "0 VNĐ";

            // do? du~ lieu. vao` combobox
            var chuDeList = requestData.GetListChuDe().ToList();
            Dictionary <int, string> data = new Dictionary <int, string>();

            chuDeList.ForEach(v =>
            {
                data.Add(v.MaChuDe, v.TenChuDe);
            });
            cbChuDe.DataSource    = new BindingSource(data, null);
            cbChuDe.DisplayMember = "Value";
            cbChuDe.ValueMember   = "Key";

            // do? du~ lieu. vao data grid view
            dgvSanPham.DataSource = requestData.GetListSanPhamByMaChuDe(chuDeList.First().MaChuDe);

            //place holder
            txtSearch.Text = "Tìm kiếm...";

            dgvGioHang.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
        }