public void loaddv() { //kn.Open(); //string sql = "SELECT dv.MA_DV N'Mã dịch vụ', dv.TEN N'Tên', ldv.LOAIDICHVU N'Loại',dv.GIA N'Giá',dv.DONVITINH N'Đơn vị tính' FROM dbo.DICHVU dv,dbo.LOAIDICHVU ldv WHERE dv.MA_LDV=ldv.MA_LDV"; //SqlCommand commandsql = new SqlCommand(sql, kn); //SqlDataAdapter com = new SqlDataAdapter(commandsql); //DataTable data = new DataTable(); //com.Fill(data); //tb_dv.DataSource = data; //kn.Close(); List <dichvu> list = new List <dichvu>(); list = client.getListDichVu().ToList(); tb_dv.DataSource = list.Select(c => new { id = c.Id, ten = c.Name, loai = c.Loaidichvu.Loai, gia = c.Gia, dvt = c.Donvitinh }).ToList(); }
public void show_dichvu() { List <dichvu> list = client.getListDichVu().ToList(); tabledichvu.DataSource = list.Select(c => new { id = c.Id, ten = c.Name, loai = c.Loaidichvu.Loai, gia = c.Gia, dvt = c.Donvitinh }).ToList(); }