public override JsonResult GetTree(MvcAdapter.QueryBuilder qb) { string sql = "select * from {0} WITH(NOLOCK) "; qb.PageSize = 0; DataTable dtTmpl = this.InstraDB.ExecuteDataTable(String.Format("select * from {0} WITH(NOLOCK) where 1!=1", this.TableName)); foreach (string key in Request.QueryString.Keys) { if (string.IsNullOrEmpty(key)) { continue; } if ("ID,FullID,FULLID,TmplCode,IsPreView,_winid,_t".Split(',').Contains(key) || key.StartsWith("$")) { continue; } if (dtTmpl.Columns.Contains(key)) { qb.Add(key, QueryMethod.In, Request[key]); } ; } this.BeforeGetTree(qb); var dt = this.InstraDB.ExecuteDataTable(String.Format(sql, this.TableName), qb); this.AfterGetTree(dt, qb); return(Json(dt)); }
public override JsonResult GetList(MvcAdapter.QueryBuilder qb) { var cbsType = this.Request["CBSType"]; if (!string.IsNullOrEmpty(cbsType)) { qb.Add("CBSType", Formula.QueryMethod.Equal, cbsType); } return(base.GetList(qb)); }
public override JsonResult GetList(MvcAdapter.QueryBuilder qb) { var statePush = qb.Items.FirstOrDefault(a => a.Field == "State"); if (statePush == null) { qb.Add("State", Formula.QueryMethod.In, "Published"); } return(base.GetList(qb)); }
public JsonResult GetOrgRoleList(MvcAdapter.QueryBuilder qb) { if (!string.IsNullOrEmpty(Request["CorpID"])) { qb.Add("CorpID", Formula.QueryMethod.In, Request["CorpID"]); } string sql = string.Format("select ID,Code,Name,Type,Description,CorpID from S_A_Role where GroupID='{0}' and Type='OrgRole'", Request["GroupID"]); if (string.IsNullOrEmpty(Request["GroupID"])) { sql = "select ID,Code,Name,Type,Description,CorpID from S_A_Role where Type='OrgRole'"; } SQLHelper sqlHelper = SQLHelper.CreateSqlHelper("Base"); return(Json(sqlHelper.ExecuteDataTable(sql, (SearchCondition)qb))); }
public JsonResult GetSysRoleList(MvcAdapter.QueryBuilder qb) { if (!string.IsNullOrEmpty(Request["CorpID"])) { qb.Add("CorpID", Formula.QueryMethod.In, Request["CorpID"]); } string sql = string.Format("select ID,Code,case when '{1}'='EN' then isnull(NameEN,Name) else Name end as Name,Type,Description,CorpID from S_A_Role where GroupID='{0}' and Type='SysRole'", Request["GroupID"], FormulaHelper.GetCurrentLGID()); if (string.IsNullOrEmpty(Request["GroupID"])) { sql = string.Format("select ID,Code,case when '{0}'='EN' then isnull(NameEN,Name) else Name end as Name,Type,Description,CorpID from S_A_Role where Type='SysRole'", FormulaHelper.GetCurrentLGID()); } SQLHelper sqlHelper = SQLHelper.CreateSqlHelper("Base"); return(Json(sqlHelper.ExecuteDataTable(sql, (SearchCondition)qb))); }