public async Task <QueryResult <CrmEntity> > QueryList(BlindOrderListRequest request) { try { var fetchString = _blindorderRepository.QueryList(request); var fetchXdoc = XDocument.Parse(fetchString); var fetchRequest = new CrmRetrieveMultipleFetchRequestMessage() { EntityName = "mcs_blindorder", FetchXml = fetchXdoc }; var fetchResponse = await _crmService.Execute(fetchRequest); var fetchResponseResult = fetchResponse as CrmRetrieveMultipleFetchResponseMessage; var queryResult = new QueryResult <CrmEntity>(); queryResult.Results = fetchResponseResult.Value.Results; queryResult.CurrentPage = request.PageIndex; //queryResult.TotalCount = 0; return(queryResult); } catch (Exception ex) { throw ex; } }
/// <summary> /// 查询预约号列表,根据预约号倒序查询(排序无改) /// </summary> /// <param name="request"></param> /// <returns></returns> public string QueryList(BlindOrderListRequest request) { var filter = string.Empty; if (!string.IsNullOrWhiteSpace(request.mcs_mobilephone)) { filter += $"<condition attribute='mcs_mobilephone' operator='eq' value='{request.mcs_mobilephone}' />"; } if (request.mcs_premiumcodestatus != null) { filter += $"<condition attribute='mcs_premiumcodestatus' operator='eq' value='{request.mcs_premiumcodestatus}' />"; } var fetchString = $@"<fetch version='1.0' count='{request.PageSize}' page='{request.PageIndex}' output-format='xml-platform' mapping='logical' distinct='false'> <entity name='mcs_blindorder'> <attribute name='mcs_name' /> <attribute name='createdon' /> <attribute name='mcs_ordertime' /> <attribute name='mcs_mobilephone' /> <attribute name='mcs_fullname' /> <attribute name='mcs_description' /> <attribute name='mcs_exteriorcolor' /> <attribute name='mcs_interiorcolor' /> <attribute name='mcs_campaignid' /> <attribute name='mcs_usecarcity' /> <attribute name='mcs_vehtype' /> <attribute name='modifiedon' /> <attribute name='mcs_premiumcode' /> <attribute name='mcs_blindorderid' /> <order attribute='mcs_premiumcode' descending='true' /> <filter type='and'> <condition attribute='statecode' operator='eq' value='0' /> <condition attribute='mcs_premiumcode' operator='not-null' /> {filter} </filter> </entity> </fetch>"; return(fetchString); }
public async Task <NewtonsoftJsonActionResult <QueryResult <CrmEntity> > > QueryList(BlindOrderListRequest request) { return(await app.QueryList(request)); }
public async Task <QueryResult <CrmEntity> > QueryList(BlindOrderListRequest request) { return(await _blindorderService.QueryList(request)); }