Beispiel #1
0
        private DataTable LoadData()
        {
            var table = new DataTable();

            table.Columns.Add(new DataColumn("ID Dịch Vụ", typeof(string)));
            table.Columns.Add(new DataColumn("Tên Dịch Vụ", typeof(string)));
            table.Columns.Add(new DataColumn("Giá", typeof(string)));
            table.Columns.Add(new DataColumn("Tình Trạng", typeof(string)));
            table.Columns.Add(new DataColumn("Chọn", typeof(bool))); //this will show checkboxes


            DichVuBUS _dvBus = new DichVuBUS();

            _data = _dvBus.LayThongTinDichVuTheoTrangThai("Đang hoạt động");

            foreach (var item in _data)
            {
                string s = Global.Instance().ConvertCurrency(item.Gia.ToString());
                table.Rows.Add(item.IdDichVu.ToString(), item.TenDichVu.ToString(), s, item.TinhTrang.ToString(), false);
            }

            return(table);
        }