//https://controltechnologysolutions.atlassian.net/browse/HAP-1176 private void HandleGridPainting(Dictionary <string, List <AttributeHolder> > toBeCheckedApprovals) { var baseQuery = @"select wochange.workorderid as workorderid from wochange as wochange left join pmchgotherapprovers as dashapprovals_ on ( wochange.wonum = dashapprovals_.wonum and wochange.pmchgapprovallevel = dashapprovals_.approvallevel and {0} ) where wochange.workorderid in ({1}) and wochange.pluspcustomer like 'HLC-%'and ({2})"; var groups = _changeWhereClauseProvider.GetPersonGroupsForQuery(); var approvalsWhereClause = _changeWhereClauseProvider.DashboardChangeApprovalsWhereClause(); var finalQuery = baseQuery.Fmt(groups, BaseQueryUtil.GenerateInString(toBeCheckedApprovals.Keys), approvalsWhereClause); var items = MaxDAO.FindByNativeQuery(finalQuery); foreach (dynamic item in items) { var workorderid = item.WORKORDERID.ToString(); if (toBeCheckedApprovals.ContainsKey(workorderid)) { List <AttributeHolder> hs = toBeCheckedApprovals[workorderid]; foreach (AttributeHolder h in hs) { h.SetAttribute("#_wonum_paintcolor", "yellow"); h.SetAttribute("##leadt", "yellow"); } } } }
public string BuildWhereClause(string entityName, QueryCacheKey.QueryMode queryMode, SearchRequestDto searchDto = null) { return(String.Format("{0} = {1}{2}", BaseQueryUtil.QualifyAttribute(_entityMetadata, _entityMetadata.Schema.IdAttribute), HibernateUtil.ParameterPrefix, ByIdQueryParameter)); }
//for each assetnum/site tuple the public IDictionary <R0042AssetKey, ISet <string> > GetClosedImacIdsForR0042(List <string> assetIds, int month, int year) { var result = new Dictionary <R0042AssetKey, ISet <string> >(); var compAppMetadata = MetadataProvider.Application(ApplicationName()); var dto = new PaginatedSearchRequestDto { NeedsCountUpdate = false }; dto.ProjectionFields.Add(ProjectionField.Default("ticketid")); dto.ProjectionFields.Add(ProjectionField.Default("ticketuid")); dto.ProjectionFields.Add(ProjectionField.Default("assetnum")); dto.ProjectionFields.Add(ProjectionField.Default("siteid")); dto.ProjectionFields.Add(ProjectionField.Default("woactivity_.OWNERGROUP")); dto.AppendWhereClauseFormat("woactivity_.OWNERGROUP = 'I-EUS-DE-CSC-SDK-ASSET' and month(woactivity_.ACTFINISH) = {0} and year(woactivity_.ACTFINISH) = {1} and imac.assetnum in ({2})", month, year, BaseQueryUtil.GenerateInString(assetIds)); var entityMetadata = MetadataProvider.SlicedEntityMetadata(new ApplicationMetadataSchemaKey("detail"), "imac"); var searchEntityResult = EntityRepository.GetAsRawDictionary(entityMetadata, dto); foreach (var imac in searchEntityResult.ResultList) { var key = new R0042AssetKey { AssetNum = imac["assetnum"].ToString(), SiteId = imac["siteid"].ToString() }; if (result.ContainsKey(key)) { result[key].Add(imac["ticketid"].ToString()); } else { result[key] = new HashSet <string> { imac["ticketid"].ToString() }; } } return(result); }