示例#1
0
        /// <summary>
        /// 试乘试驾路线
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <QueryResult <CrmEntity> > QueryDriveRouteList(DriveRouteRequest request)
        {
            var userInfo = ContextContainer.GetValue <UserInfo>(ContextExtensionTypes.CurrentUserInfo);

            if (userInfo != null && !string.IsNullOrWhiteSpace(userInfo.mcs_dealerid))
            {
                // request.DealerId = Guid.Parse(userInfo.mcs_dealerid);
            }
            #region 查询结果集
            var fetchString = _driveRecordRepository.QueryDriveRouteList(request);

            var fetchXdoc    = XDocument.Parse(fetchString);
            var fetchRequest = new CrmRetrieveMultipleFetchRequestMessage()
            {
                EntityName  = "mcs_driveroute",
                FetchXml    = fetchXdoc,
                ProxyUserId = userInfo?.systemuserid
            };
            fetchRequest.Headers.Add(dicHeadKey, dicHead[dicHeadKey]);
            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);

            #endregion
        }
示例#2
0
        /// <summary>
        /// 试乘试驾路线
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public string QueryDriveRouteList(DriveRouteRequest request)
        {
            var filter = string.Empty;

            if (!string.IsNullOrWhiteSpace(request.Search))
            {
                filter += $"<filter type='or'>";
                filter += $"<condition attribute='mcs_name' operator='like' value='%{request.Search}%' />";
                filter += $"<condition attribute='mcs_start' operator='like' value='%{request.Search}%' />";
                filter += $"<condition attribute='mcs_end' operator='like' value='%{request.Search}%' />";
                filter += $"</filter>";
            }
            var fetchString = $@"<fetch version='1.0' count='{request.PageSize}' page='{request.PageIndex}' output-format='xml-platform' mapping='logical' distinct='false'>
                  <entity name='mcs_driveroute'>
                    <all-attributes />
                    <filter type='and'>
                      <condition attribute='statecode' operator='eq' value='0' />
                      {filter}
                    </filter>
                  </entity>
                </fetch>";

            return(fetchString);
        }
示例#3
0
        public async Task <NewtonsoftJsonActionResult <QueryResult <CrmEntity> > > QueryDriveRouteList([FromQuery] DriveRouteRequest request)
        {
            var list = await app.QueryDriveRouteList(request);

            return(list);
        }
示例#4
0
 /// <summary>
 /// 试乘试驾路线
 /// </summary>
 /// <param name="request"></param>
 /// <returns></returns>
 public async Task <QueryResult <CrmEntity> > QueryDriveRouteList(DriveRouteRequest request)
 {
     return(await _driveRecordService.QueryDriveRouteList(request));
 }