public JsonResult GetSQLInfo(int SQLId) { if (SQLId < 1) { return(FailResult("SQLId不合法")); } VViewModel vModel = new VViewModel(); //获取分类列表 Tsql_ClassifyCollection daclassifyColl = new Tsql_ClassifyCollection(); daclassifyColl.SelectClassify(); Tsql_View daview = new Tsql_View(); daview.SelectSQLBySqlId(SQLId); vModel = MapProvider.Map <VViewModel>(daview.DataRow); List <Classify> list = new List <Classify>(); list = MapProvider.Map <Classify>(daclassifyColl.DataTable); vModel.classifylist = new List <Classify>(); foreach (var item in list) { vModel.classifylist.Add(item); } return(SuccessResult(vModel)); }
// GET: SQLManager public ActionResult Index() { Tsql_ClassifyCollection daClassifyColl = new Tsql_ClassifyCollection(); daClassifyColl.SelectClassify(); List <Classify> classifyList = MapProvider.Map <Classify>(daClassifyColl.DataTable); ViewBag.JsonClassify = JsonProvider.ToJson(classifyList); return(View()); }
public JsonResult Index(FormCollection form) { Tsql_ClassifyCollection daClassifyColl = new Tsql_ClassifyCollection(); daClassifyColl.ChangePage = this.ChangePage(); daClassifyColl.SelectClassify(); List <VclassifyModel> list = MapProvider.Map <VclassifyModel>(daClassifyColl.DataTable); return(SuccessResultList(list, daClassifyColl.ChangePage)); }
// GET: UseSQL public ActionResult Index(int?SQLId) { if (SQLId > 0) { ViewBag.SQLID = SQLId; } else { ViewBag.SQLID = 0; } Tsql_ClassifyCollection daclassifyColl = new Tsql_ClassifyCollection(); VViewModel vModel = new VViewModel(); vModel.classifylist = new List <Classify>(); daclassifyColl.SelectClassify(); List <Classify> list = MapProvider.Map <Classify>(daclassifyColl.DataTable); foreach (var item in list) { vModel.classifylist.Add(item); } return(View(vModel)); }