private void dgLog_LoadingDataSource(object sender, LoadingDataEventArgs e) { LogQueryModel queryModel = e.QueryCriteria as LogQueryModel; if (queryModel != null) { LogQueryCriteria queryCriteria = queryModel.ToQueryCriteria(); queryCriteria.PagingInfo = new Newegg.Oversea.Silverlight.CommonDomain.QueryLogService.PagingInfo() { PageSize = e.PageSize, StartRowIndex = e.PageIndex * e.PageSize, SortField = e.SortField }; this.ButtonSearch.IsEnabled = false; this.m_queryLogEntryClient.GetLogsAsync(queryCriteria); } }
public static LogQueryCriteria ToQueryCriteria(this LogQueryModel queryModel) { LogQueryCriteria queryCriteria = null; if (queryModel != null) { queryCriteria = new LogQueryCriteria() { GlobalID = queryModel.GlobalID.GetValue(), LocalID = queryModel.LocalID.GetValue(), CategoryName = queryModel.CategoryName.GetValue(), LogType = queryModel.LogType.GetLogType(), From = queryModel.CreateDateFrom, To = queryModel.CreateDateTo, LogID = queryModel.LogID.GetValue(), ReferenceKey = queryModel.ReferenceKey.GetValue(), }; } return(queryCriteria); }