Esempio n. 1
0
        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 = "参数传递错误!" }));
            }
        }
Esempio n. 2
0
        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 = "参数传递错误!" }));
            }
        }
Esempio n. 3
0
        public ActionResult QuerySet()
        {
            string strTableName = Request.Form["tablename"];
            string strItems     = Request.Form["items"];

            if (!string.IsNullOrEmpty(strTableName) && !string.IsNullOrEmpty(strItems))
            {
                SysSetFormService service           = new SysSetFormService();
                Cupcake.Core.Domain.SysSetForm data = service.GetAll().Where(m => m.TableName == strTableName).ToList().FirstOrDefault();

                if (data != null)
                {
                    data.QueryCriteria = strItems;
                    int rv = service.Modify(data);

                    if (rv > 0)
                    {
                        return(Json(new { result = "success" }));
                    }
                    else
                    {
                        return(Json(new { result = "fail", msg = "设置失败!" }));
                    }
                }
                else
                {
                    return(Json(new { result = "fail", msg = "设置失败!" }));
                }
            }
            else
            {
                return(Json(new { result = "fail", msg = "没有选择查询条件!" }));
            }
        }
Esempio n. 4
0
        //
        // 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());
        }