// GET: Doans/Details/5 public async Task <ActionResult> Details(int?id) { Doan doans = null; HttpResponseMessage response = await client.GetAsync(url + @"Doans/" + id); if (response.IsSuccessStatusCode) { ViewBag.accept = false; doans = await response.Content.ReadAsAsync <Doan>(); HttpResponseMessage responseMessage = await client.GetAsync(url + @"Danhmucdoans/"); List <Danhmucdoan> danhmucdoans = DanhmucdoansController.getAllDanhmucdoan(responseMessage); danhmucdoans = danhmucdoans.Where(n => n.MaDM == id).ToList(); ViewBag.Danhmucdoan = danhmucdoans; } return(View(doans)); }
// GET: Cuahangs/Details/5 public async Task <ActionResult> Details(int?id) { Cuahang cuahangs = null; HttpResponseMessage response = await client.GetAsync(url + @"Cuahangs/" + id); if (response.IsSuccessStatusCode) { cuahangs = await response.Content.ReadAsAsync <Cuahang>(); //dong hoac mo data table ViewBag.accept = false; // Call api HttpResponseMessage responseMessage = await client.GetAsync(url + @"Danhmucdoans/"); // Get all data List <Danhmucdoan> danhmucdoans = DanhmucdoansController.getAllDanhmucdoan(responseMessage); // Check data danhmucdoans = danhmucdoans.Where(n => n.MaCH == id).ToList(); ViewBag.danhmuc = danhmucdoans; } return(View(cuahangs)); }