Retrieve() публичный Метод

public Retrieve ( string entityName, System.Guid id, ColumnSet columnSet ) : Entity
entityName string
id System.Guid
columnSet ColumnSet
Результат Entity
Пример #1
0
        /// <summary>
        /// 唯一线索详情查询
        /// </summary>
        /// <param name="entityid"></param>
        /// <returns></returns>
        public async Task <CrmEntity> GetOnlyLeadDetail(string entityid)
        {
            try
            {
                var dicHead = new Dictionary <string, IEnumerable <string> >();
                dicHead.Add("Prefer", new List <string>()
                {
                    "odata.include-annotations=\"*\""
                });

                //var fetchString = _onlyLeadRepository.GetOnlyLeadDetail(entityid);
                CrmEntity entity = null;
                entity = await _crmService.Retrieve("mcs_onlylead", Guid.Parse(entityid), "", null, dicHead);

                return(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        public async Task <VehorderDetailModel> GetVehorderDetail(string mcs_vehorderid)
        {
            try
            {
                VehorderDetailModel model = new VehorderDetailModel();

                var userInfo    = ContextContainer.GetValue <UserInfo>(ContextExtensionTypes.CurrentUserInfo);
                var ProxyUserId = userInfo != null ? userInfo.systemuserid : null;

                #region 整车订单基本信息
                var dicHead = new Dictionary <string, IEnumerable <string> >();
                dicHead.Add("Prefer", new List <string>()
                {
                    "odata.include-annotations=\"*\""
                });
                var VehorderData = await _crmService.Retrieve("mcs_vehorder", Guid.Parse(mcs_vehorderid), string.Empty, ProxyUserId, dicHead);

                #endregion

                #region 订单透明化状态跟踪mcs_vehordertrack

                var fetchString_One = _vehorderRepository.GetVehordertrackList(mcs_vehorderid);

                var fetchXdoc_One    = XDocument.Parse(fetchString_One);
                var fetchRequest_One = new CrmRetrieveMultipleFetchRequestMessage()
                {
                    EntityName  = "mcs_vehordertrack",
                    FetchXml    = fetchXdoc_One,
                    ProxyUserId = ProxyUserId
                };
                var fetchResponse_One = await _crmService.Execute(fetchRequest_One);

                var fetchResponseResult_One = fetchResponse_One as CrmRetrieveMultipleFetchResponseMessage;

                #endregion

                #region 权益项mcs_rightitemuse

                var fetchString_Two = _vehorderRepository.GetRightitemuseList(mcs_vehorderid);

                var fetchXdoc_Two    = XDocument.Parse(fetchString_Two);
                var fetchRequest_Two = new CrmRetrieveMultipleFetchRequestMessage()
                {
                    EntityName  = "mcs_rightitemuse",
                    FetchXml    = fetchXdoc_Two,
                    ProxyUserId = ProxyUserId
                };
                var fetchResponse_Two = await _crmService.Execute(fetchRequest_Two);

                var fetchResponseResult_Two = fetchResponse_Two as CrmRetrieveMultipleFetchResponseMessage;

                #endregion

                model.VehorderInfo  = VehorderData;
                model.Vehordertrack = fetchResponseResult_One.Value.Results;
                model.Rightitemuse  = fetchResponseResult_Two.Value.Results;
                return(model);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }