public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); spConditions.DataContext = m_query = new VendorSystemQueryFilter(); //CodePair CodeNamePairHelper.GetList(ConstValue.DomainName_ExternalSYS , new string[] { ConstValue.Key_ExternalSYSLogType } , CodeNamePairAppendItemType.All, (o, p) => { this.cmbLogType.ItemsSource = p.Result[ConstValue.Key_ExternalSYSLogType]; this.cmbLogType.SelectedIndex = 0; }); }
/// <summary> /// 日志查询 /// </summary> /// <param name="query">过滤条件</param> /// <param name="callback">回调函数</param> public void QueryLog(VendorSystemQueryFilter query, EventHandler <RestClientEventArgs <dynamic> > callback) { string relativeUrl = "/ExternalSYSService/ExternalSYS/QueryVendorSystemLog"; restClient.QueryDynamicData(relativeUrl, query, callback); }
public DataTable LogQuery(VendorSystemQueryFilter filter, out int dataCount) { if (filter.PagingInfo.SortBy != null) { string sortCondition = filter.PagingInfo.SortBy.Trim(); Match match = Regex.Match(sortCondition, @"^(?<SortColumn>[\S]+)(?:\s+(?<SortType>ASC|DESC))?$", RegexOptions.IgnoreCase); if (match.Groups["SortColumn"].Success) { string sortColumn = match.Groups["SortColumn"].Value; string sortType = match.Groups["SortType"].Success ? match.Groups["SortType"].Value : "DESC"; switch (sortColumn) { case "Region": filter.PagingInfo.SortBy = String.Format("{0} {1}", "l.RegionSysNo", sortType); break; case "Category": filter.PagingInfo.SortBy = String.Format("{0} {1}", "l.CategorySysNo", sortType); break; case "Date": filter.PagingInfo.SortBy = String.Format("{0} {1}", "l.LogCreateDate", sortType); break; case "ReferenceKey": filter.PagingInfo.SortBy = String.Format("{0} {1}", "l.ReferenceKey", sortType); break; case "LogType": filter.PagingInfo.SortBy = String.Format("{0} {1}", "l.LogType", sortType); break; } } } CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("ExternalSYS_Query_VendorLogs"); using (DynamicQuerySqlBuilder builder = new DynamicQuerySqlBuilder( command.CommandText, command, HelpDA.ToPagingInfo(filter.PagingInfo), "l.SysNo DESC")) { builder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "l.RegionSysNo", DbType.Int32, "@RegionSysNo", QueryConditionOperatorType.Equal, filter.RegionSysNo); builder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "l.CategorySysNo", DbType.Int32, "@CategorySysNo", QueryConditionOperatorType.Equal, filter.CategorySysNo); builder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "l.LogCreateDate", DbType.DateTime, "@DateFrom", QueryConditionOperatorType.MoreThanOrEqual, filter.DateFrom); builder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "l.LogCreateDate", DbType.DateTime, "@DateTo", QueryConditionOperatorType.LessThanOrEqual, filter.DateTo); builder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "l.LogType", DbType.AnsiStringFixedLength, "@LogType", QueryConditionOperatorType.Equal, filter.LogType); command.CommandText = builder.BuildQuerySql(); var dt = command.ExecuteDataTable(); dataCount = Convert.ToInt32(command.GetParameterValue("@TotalCount")); return(dt); } }
public QueryResult QueryVendorSystemLog(VendorSystemQueryFilter filter) { return(QueryList <VendorSystemQueryFilter>(filter, ObjectFactory <IVendorSystemInfoDA> .Instance.LogQuery)); }