Exemplo n.º 1
0
        /// <summary>
        /// 查询故障类别代码
        /// </summary>
        /// <param name="malFunctionTypeRequest"></param>
        /// <returns></returns>
        public async Task <QueryResult <CrmEntity> > QueryMalFunctionType(MalFunctionTypeRequest malFunctionTypeRequest)
        {
            try
            {
                var fetchString = _baseDataRepository.QueryMalFunctionType(malFunctionTypeRequest);

                var fetchXdoc    = XDocument.Parse(fetchString);
                var fetchRequest = new CrmRetrieveMultipleFetchRequestMessage()
                {
                    EntityName = "mcs_malfunctiontype",
                    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 = malFunctionTypeRequest.page;
                queryResult.TotalCount  = 0;
                return(queryResult);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public async Task <NewtonsoftJsonActionResult <QueryResult <CrmEntity> > > QueryMalFunctionType(string seachkey = "", string sort = "", int pageSize = 10, int page = 1)
        {
            var malFunctionTypeRequest = new MalFunctionTypeRequest()
            {
                search   = seachkey,
                page     = page,
                pageSize = pageSize,
                sort     = sort
            };
            var list = await app.QueryMalFunctionType(malFunctionTypeRequest);

            return(list);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 查询故障类别代码基础数据
        /// </summary>
        /// <param name="malFunctionTypeRequest"></param>
        /// <returns></returns>
        public string QueryMalFunctionType(MalFunctionTypeRequest malFunctionTypeRequest)
        {
            var filter = string.Empty;

            if (!string.IsNullOrWhiteSpace(malFunctionTypeRequest.search))
            {
                filter += $"<filter type='and'>";
                filter += $"<condition attribute='mcs_name' operator='like' value='%{malFunctionTypeRequest.search}%' />";
                filter += $"</filter>";
            }

            var fetchString = $@"<fetch version='1.0' count='{malFunctionTypeRequest.pageSize}' page='{malFunctionTypeRequest.page}' output-format='xml-platform' mapping='logical' distinct='false'>
                  <entity name='mcs_malfunctiontype'>
                    <attribute name='mcs_name' />
                    <attribute name='createdon' />
                    <attribute name='mcs_malfunctiontypedescription' />
                    <attribute name='mcs_malfunctiontypename' />
                    <attribute name='mcs_vrt' />
                    <attribute name='mcs_vfg' />
                    <attribute name='mcs_malfunctiontypeid' />
                    <order attribute='mcs_name' descending='false' />
                    <filter type='and'>
                      <condition attribute='statecode' operator='eq' value='0' />
                        {filter}
                    </filter>
                    <link-entity name='mcs_vfg' from='mcs_vfgid' to='mcs_vfg' visible='false' link-type='outer' alias='vfg'>
                      <attribute name='mcs_name' />
                    </link-entity>
                    <link-entity name='mcs_vrt' from='mcs_vrtid' to='mcs_vrt' visible='false' link-type='outer' alias='vrt'>
                      <attribute name='mcs_name' />
                    </link-entity>
                  </entity>
                </fetch>";

            return(fetchString);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 查询故障类别代码
 /// </summary>
 /// <param name="malFunctionTypeRequest"></param>
 /// <returns></returns>
 public async Task <QueryResult <CrmEntity> > QueryMalFunctionType(MalFunctionTypeRequest malFunctionTypeRequest)
 {
     return(await _baseDataService.QueryMalFunctionType(malFunctionTypeRequest));
 }