#region 图书类型
public ActionResult CategryTreePartial()
{
Uri uri = new Uri(path);
HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = uri;
var pashAction = httpClient.GetAsync("api/Category");
var pashResult = pashAction.Result;
if (pashResult.StatusCode == System.Net.HttpStatusCode.OK)
{
var result = pashResult.Content.ReadAsStringAsync().Result;
var list = JsonConvert.DeserializeObject>(result);
httpClient.Dispose();
ViewBag.categryList = list;
return PartialView("CategryTreePartial",list);
}
else
{
return Content("获取代码错误:" + pashResult.StatusCode);
}
}
#endregion
#region 图书类型实现下拉框功能
public ActionResult CListPritial()
{
//List
Uri uri = new Uri(path);
HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = uri;
var pashAction = httpClient.GetAsync("api/Category");
var pashResult = pashAction.Result;
if (pashResult.StatusCode == System.Net.HttpStatusCode.OK)
{
var result = pashResult.Content.ReadAsStringAsync().Result;
var list = JsonConvert.DeserializeObject>(result);
SelectList slist = new SelectList(list, "Id", "Name");
ViewBag.categoryList = slist;
httpClient.Dispose();
return PartialView("CListPritial", slist);
}
else
{
return Content("获取代码错误:" + pashResult.StatusCode);
}
}
#endregion
#region 图书类型
public ActionResult CategryTreePartial()
{
Uri uri = new Uri(path);
HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = uri;
var pashAction = httpClient.GetAsync("api/Category");
var pashResult = pashAction.Result;
if (pashResult.StatusCode == System.Net.HttpStatusCode.OK)
{
var result = pashResult.Content.ReadAsStringAsync().Result;
var list = JsonConvert.DeserializeObject>(result);
httpClient.Dispose();
ViewBag.categryList = list;
return PartialView("CategryTreePartial",list);
}
else
{
return Content("获取代码错误:" + pashResult.StatusCode);
}
}
#endregion
#region 图书类型实现下拉框功能
public ActionResult CListPritial()
{
//List
Uri uri = new Uri(path);
HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = uri;
var pashAction = httpClient.GetAsync("api/Category");
var pashResult = pashAction.Result;
if (pashResult.StatusCode == System.Net.HttpStatusCode.OK)
{
var result = pashResult.Content.ReadAsStringAsync().Result;
var list = JsonConvert.DeserializeObject>(result);
SelectList slist = new SelectList(list, "Id", "Name");
ViewBag.categoryList = slist;
httpClient.Dispose();
return PartialView("CListPritial", slist);
}
else
{
return Content("获取代码错误:" + pashResult.StatusCode);
}
}
#endregion