public ActionResult GetIndexData() { string strTableName = Request.Form["tablename"]; if (!string.IsNullOrEmpty(strTableName)) { SysSetFormService service = new SysSetFormService(); List <SysSetForm> list = service.GetAll().Where(m => m.TableName == strTableName).ToList(); if (list != null && list.Count > 0) { SysSetForm model = list[0]; //获取数据 string strColumns = GetColumnNames(model.Columns); string strDatas = service.SelectData(strTableName, strColumns); return(Json(new { result = "success", functionname = model.FuntionName, querycriteria = model.QueryCriteria, columns = model.Columns, datas = strDatas })); } else { return(Json(new { result = "fail", msg = "没有相应的表单设置!" })); } } else { return(Json(new { result = "fail", msg = "参数传递错误!" })); } }
public ActionResult GetCreateData() { string strTableName = Request.Form["tablename"]; if (!string.IsNullOrEmpty(strTableName)) { SysSetFormService service = new SysSetFormService(); List <SysSetForm> list = service.GetAll().Where(m => m.TableName == strTableName).ToList(); if (list != null && list.Count > 0) { SysSetForm model = list[0]; return(Json(new { result = "success", functionname = model.FuntionName, columns = model.Columns })); } else { return(Json(new { result = "fail", msg = "没有相应的表单设置!" })); } } else { return(Json(new { result = "fail", msg = "参数传递错误!" })); } }
// // GET: /ShowForm/ public ActionResult Index() { string tablename = Request.QueryString["t"]; if (!string.IsNullOrEmpty(tablename)) { SysSetFormService service = new SysSetFormService(); SysSetForm model = service.GetAll().Where(m => m.TableName == tablename).ToList().FirstOrDefault(); if (model != null) { ViewBag.funtionname = model.FuntionName; } } ViewBag.tablename = tablename; return(View()); }