private BPMDBParameterCollection GetSelectParameters(MyColumnInfoCollection columnInfos) { BPMDBParameterCollection selectParameters = new BPMDBParameterCollection(); //添加过滤条件 foreach (MyColumnInfo column in columnInfos) { if (!column.FixFilter) { continue; } BPMDBParameter parameter = new BPMDBParameter(column.ColumnName, TypeCode.String, column.FixFilterValue); parameter.ParameterCompareType = ParameterCompareType.FullCompare | ParameterCompareType.NecessaryCondition; selectParameters.Add(parameter); } //添加搜索条件 string sch = this.Page.Request.QueryString["sch"]; if (!String.IsNullOrEmpty(sch)) { sch = sch.Trim(); string schtype = this.Page.Request.QueryString["schtype"]; if (String.IsNullOrEmpty(schtype) || schtype == "all") { foreach (MyColumnInfo column in columnInfos) { if (!column.Display) { continue; } BPMDBParameter parameter = new BPMDBParameter(column.ColumnName, TypeCode.String, sch); parameter.ParameterCompareType = ParameterCompareType.LikeCompare | ParameterCompareType.OptionCondition; selectParameters.Add(parameter); } } else { BPMDBParameter parameter = new BPMDBParameter(schtype, TypeCode.String, sch); parameter.ParameterCompareType = ParameterCompareType.LikeCompare | ParameterCompareType.OptionCondition; selectParameters.Add(parameter); } } return(selectParameters); }
public virtual DataTable GetProcedureDataNoPaged(HttpContext context) { YZRequest request = new YZRequest(context); string dataSourceName = request.GetString("DataSource", null); string procedureName = request.GetString("ProcedureName"); YZDSFilterCollection filters = JObject.Parse(request.GetString("Filter", "{}")).ToObject <YZDSFilterCollection>(); BPMDBParameterCollection @params = new BPMDBParameterCollection(); if (filters != null) { foreach (KeyValuePair <string, YZDSFilter> filter in filters) { BPMDBParameter paramater = new BPMDBParameter(filter.Key, typeof(String), filter.Value.value); @params.Add(paramater); } } using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); FlowDataTable table = DataSourceManager.ExecProcedure(cn, dataSourceName, procedureName, @params); return(table.ToDataTable()); } }
public virtual DataTable GetTableDataNoPaged(HttpContext context) { YZRequest request = new YZRequest(context); string dataSourceName = request.GetString("DataSource", null); string tableName = request.GetString("TableName"); string orderBy = request.GetString("OrderBy", null); YZDSFilterCollection filters = JObject.Parse(request.GetString("Filter", "{}")).ToObject <YZDSFilterCollection>(); BPMDBParameterCollection @params = new BPMDBParameterCollection(); if (filters != null) { foreach (KeyValuePair <string, YZDSFilter> filter in filters) { BPMDBParameter paramater = new BPMDBParameter(filter.Key, typeof(String), filter.Value.value); paramater.ParameterCompareType = BPMDBParameter.ParseOp(filter.Value.op, ParameterCompareType.Equ) | ParameterCompareType.NecessaryCondition; @params.Add(paramater); } } using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); FlowDataTable table = DataSourceManager.LoadTableData(cn, dataSourceName, tableName, @params, orderBy); return(table.ToDataTable()); } }
public virtual JObject GetUserDataProcedure(BPMConnection cn, JObject request) { string dataSourceName = (string)request["DataSource"]; string procedureName = (string)request["ProcedureName"]; YZDSFilterCollection filters = request["Filter"] != null ? request["Filter"].ToObject <YZDSFilterCollection>() : null; BPMDBParameterCollection @params = new BPMDBParameterCollection(); if (filters != null) { foreach (KeyValuePair <string, YZDSFilter> filter in filters) { BPMDBParameter paramater = new BPMDBParameter(filter.Key, typeof(String), filter.Value.value); @params.Add(paramater); } } FlowDataTable table = DataSourceManager.ExecProcedure(cn, dataSourceName, procedureName, @params); return(this.ToResult(table, false)); }
public virtual JObject GetUserDataTable(BPMConnection cn, JObject request) { string dataSourceName = (string)request["DataSource"]; string tableName = (string)request["TableName"]; string orderBy = (string)request["OrderBy"]; YZDSFilterCollection filters = request["Filter"] != null ? request["Filter"].ToObject <YZDSFilterCollection>() : null; BPMDBParameterCollection @params = new BPMDBParameterCollection(); if (filters != null) { foreach (KeyValuePair <string, YZDSFilter> filter in filters) { BPMDBParameter paramater = new BPMDBParameter(filter.Key, typeof(String), filter.Value.value); paramater.ParameterCompareType = BPMDBParameter.ParseOp(filter.Value.op, ParameterCompareType.Equ) | ParameterCompareType.NecessaryCondition; @params.Add(paramater); } } FlowDataTable table = DataSourceManager.LoadTableData(cn, dataSourceName, tableName, @params, orderBy); return(this.ToResult(table, false)); }