Ejemplo n.º 1
0
        /// <summary>
        /// 获取预约跟进记录
        /// </summary>
        /// <param name="logRequest"></param>
        /// <returns></returns>
        public async Task <QueryResult <CrmEntity> > GetLog(AppointmentInfoLogRequest logRequest)
        {
            try
            {
                var fetchString = _appointmentInfoRepository.Querylog(logRequest);

                var fetchXdoc    = XDocument.Parse(fetchString);
                var fetchRequest = new CrmRetrieveMultipleFetchRequestMessage()
                {
                    EntityName = "mcs_appointmentinfolog",
                    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 = logRequest.page;
                queryResult.TotalCount  = 0;
                return(queryResult);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 预约单跟进记录
        /// </summary>
        /// <param name="logRequest"></param>
        /// <returns></returns>
        public string Querylog(AppointmentInfoLogRequest logRequest)
        {
            var filter = string.Empty;

            if (!string.IsNullOrWhiteSpace(logRequest.entityid))
            {
                filter += $"<condition attribute='mcs_appointmentinfoid' operator='eq' value='{logRequest.entityid}' />";
            }
            var fetchString = $@"<fetch version='1.0' count='{logRequest.pageSize}' page='{logRequest.page}' output-format='xml-platform' mapping='logical' distinct='false'>
                    <entity name='mcs_appointmentinfolog'>
                    <attribute name='createdon' />
                    <attribute name='mcs_remark' />
                    <attribute name='createdby' />
                    <attribute name='mcs_appointmentinfologid' />
                    <order attribute='createdon' descending='false' />
                    <filter type='and'>
                      <condition attribute='statecode' operator='eq' value='0' />
                      {filter}
                    </filter>
                    <link-entity name='systemuser' from='systemuserid' to='createdby' visible='false' link-type='outer' alias='systemuser'>
                      <attribute name='fullname' />
                    </link-entity>
                  </entity>
                </fetch>";

            return(fetchString);
        }
Ejemplo n.º 3
0
        public async Task <NewtonsoftJsonActionResult <QueryResult <CrmEntity> > > GetLog(string entityid = "", string sort = "", int pageSize = 10, int page = 1)
        {
            var appointmentInfoLogRequest = new AppointmentInfoLogRequest()
            {
                entityid = entityid,
                page     = page,
                pageSize = pageSize,
                sort     = sort
            };
            var list = await app.GetLog(appointmentInfoLogRequest);

            return(list);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 预约单跟进记录
 /// </summary>
 /// <param name="appointmentInfoLogRequest"></param>
 /// <returns></returns>
 public async Task<QueryResult<CrmEntity>> GetLog(AppointmentInfoLogRequest appointmentInfoLogRequest)
 {
     return await _appointmentInfoService.GetLog(appointmentInfoLogRequest);
 }