private void savepostdata(string Data, string layoutid) { try { StringBuilder sb = new StringBuilder(); BLL.LayOutForm bll = new BLL.LayOutForm(); string layoutTablename = ""; List <string> list = bll.getTableColName(layoutid, out layoutTablename); //获取表单对应的表及列名 List <KeyValueModel> kvlist = new List <KeyValueModel>(); var aQuery = Data.Split('&'); //post数据处理为List<T> for (var i = 0; i < aQuery.Length; i++) { var k = aQuery[i].IndexOf("="); if (k == -1) { continue; } var key = aQuery[i].Substring(0, k); var value = aQuery[i].Substring(k + 1); kvlist.Add(new KeyValueModel { key = key, value = value }); } List <KeyValueModel> flist = fliterList(list, kvlist); //过滤列对应的用户表单数据 insertPostData(layoutTablename, flist); //插入数据 result = "保存成功"; } catch (Exception ex) { result = ex.Message; } }
private void GetJsonData(string pageindex, string pagesize, string wheres, string layoutid) { //string layoutid = "2"; BLL.LayOutForm bll = new BLL.LayOutForm(); string layoutTablename = ""; List <string> list = bll.getTableColName(layoutid, out layoutTablename); //获取表单对应的表及列名 string pagecount = ""; DataTable dt = bll.GetDataTable(layoutTablename, wheres, pageindex, pagesize, out pagecount); //将DataTable封装为控件使用的json格式 productJsonData(dt, pagecount); }
private void CreateForm(string formName, string HtmlStr, List <TableModel> list) { BLL.LayOutForm bll = new BLL.LayOutForm(); bll.insert(formName, HtmlStr, list); //插入一条表单模板数据 }
private void insertPostData(string layoutTablename, List <KeyValueModel> flist) { BLL.LayOutForm bll = new BLL.LayOutForm(); bool bl = bll.insertPostData(layoutTablename, flist); }