Beispiel #1
0
        public ActionResult LoadField(string dataSource = "", string tableName = "")
        {
            List <object> dataParams = new List <object>();

            dataParams.Add("@pageSize");
            dataParams.Add("1");
            dataParams.Add("@pageNum");
            dataParams.Add("1");
            object[]  parms  = new object[] { "@tableName", tableName.Trim() };
            DataTable fTable = new SqlFieldFilterAutoDao().GetDataTable(parms, "cofTableRenderAuto_GetAllColumnForFilter");

            if (fTable != null && fTable.Rows.Count > 0)
            {
                foreach (DataRow r in fTable.Rows)
                {
                    if (r["FieldType"] != null)
                    {
                        if (r["FieldType"].ToString() != "")
                        {
                            dataParams.Add(r["COLUMN_NAME"].ToString());
                            dataParams.Add(Request[r["COLUMN_NAME"].ToString()] != null ? Request[r["COLUMN_NAME"].ToString()] : "");
                        }
                    }
                }
            }
            #region 'Load List Data'
            DataTable result = new SqlFieldListAutoDao().GetDataTable(dataParams.ToArray(), dataSource);
            #endregion
            ViewBag.Resources   = new SqlResourceListAutoDao().GetFilter(tableName);
            ViewBag.TableRender = tableName;
            ViewBag.DataSource  = dataSource;
            return(View(result));
        }
Beispiel #2
0
        public ActionResult GetAllTableColumnForList(string tableName = "")
        {
            object[]  parms = new object[] { "@tableName", tableName.Trim() };
            DataTable table = new SqlFieldListAutoDao().GetDataTable(parms, "cofTableRenderAuto_GetAllColumnForList");

            ViewBag.DataSource      = new SqlTableRenderAutoDao().GetTableRenderAuto(tableName);
            ViewBag.StoreProcedures = new SqlSelectListDao().GetSelectLists("[dbo].[spSelectList_GetFilterStoreProcedure]");
            ViewBag.TableName       = tableName;
            return(View(table));
        }