/// <summary> /// Convert entity to service contract. /// </summary> /// <returns></returns> public LogCategoryQueryCriteria ToContract() { LogCategoryQueryCriteria contract = new LogCategoryQueryCriteria() { GlobalID = this.m_globalID, LocalID = this.m_localID, CategoryName = this.m_categoryName }; switch (this.m_logType) { case "A": contract.LogType = LogType.Audit; break; case "D": contract.LogType = LogType.Debug; break; case "E": contract.LogType = LogType.Error; break; case "I": contract.LogType = LogType.Info; break; case "T": contract.LogType = LogType.Trace; break; default: contract.LogType = new Nullable <LogType>(); break; } switch (this.m_status) { case "A": contract.Status = Status.Active; break; case "I": contract.Status = Status.Inactive; break; default: contract.Status = new Nullable <Status>(); break; } return(contract); }
private void DataGridLogCategoryLoadingDataSource(object sender, LoadingDataEventArgs e) { var queryModel = e.QueryCriteria as CategoryQueryModel; if (queryModel != null) { LogCategoryQueryCriteria queryCriteria = queryModel.ToContract(); queryCriteria.PagingInfo = new PagingInfo { PageSize = e.PageSize, StartRowIndex = e.PageIndex * e.PageSize, SortField = e.SortField }; m_queryLogConfigClient.GetCategoryConfigsAsync(queryCriteria); ButtonSearch.IsEnabled = false; } }
private void ddlLocal_SelectionChanged(object sender, SelectionChangedEventArgs e) { LogLocalRegionBody selectedItem = this.ddlLocal.SelectedItem as LogLocalRegionBody; if (selectedItem != null && selectedItem.GlobalID != null && selectedItem.LocalID != null) { LogCategoryQueryCriteria queryCriteria = new LogCategoryQueryCriteria() { GlobalID = selectedItem.GlobalID, LocalID = selectedItem.LocalID, Status = Status.Active }; var dataSource = GridSearchArea.DataContext; ddlCategory.IsShowLoading = true; this.m_queryLogConfigClient.GetCategoryConfigsAsync(queryCriteria, dataSource); } else { this.ddlCategory.ItemsSource = null; this.ddlCategory.IsEnabled = false; } }