public async Task <XDocument> GetListFetchXml(SalesOrderListRequest salesOrderListRequest) { return(await Task <XDocument> .Run(() => { var filterStr = ""; var fetchXml = $@"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'> <entity name='mcs_tc_productorderitem'> <attribute name='mcs_tc_productorderitemid' /> <attribute name='mcs_name' /> <attribute name='createdon' /> <attribute name='mcs_productsku' /> <attribute name='mcs_totalprice' /> <attribute name='transactioncurrencyid' /> <attribute name='ownerid' /> <attribute name='mcs_order' /> <attribute name='mcs_totalintegral' /> <attribute name='mcs_unitintegral' /> <attribute name='statuscode' /> <attribute name='statecode' /> <attribute name='exchangerate' /> <attribute name='mcs_itemtype' /> <attribute name='mcs_count' /> <attribute name='mcs_paytype' /> <attribute name='mcs_suborder' /> <attribute name='mcs_product' /> <attribute name='mcs_unitprice_base' /> <attribute name='mcs_unitprice' /> <attribute name='overriddencreatedon' /> <attribute name='createdonbehalfby' /> <attribute name='createdby' /> <attribute name='modifiedonbehalfby' /> <attribute name='modifiedby' /> <attribute name='modifiedon' /> <attribute name='mcs_totalprice_base' /> <order attribute='mcs_name' descending='false' /> <link-entity name='mcs_tc_order' from='mcs_tc_orderid' to='mcs_order' link-type='inner' alias='aa'> <attribute name='mcs_paystatus' /> <filter type='and'> <condition attribute='mcs_orderclass' operator='eq' value='100' /> <condition attribute='mcs_userid' operator='eq' value='{salesOrderListRequest.UserId}' /> </filter> </link-entity> <link-entity name='mcs_tc_product' from='mcs_tc_productid' to='mcs_product' link-type='inner' alias='bb'> <attribute name='mcs_type' /> <filter type='and'> <condition attribute='mcs_type' operator='eq' value='1' /> </filter> </link-entity> </entity> </fetch>"; return XDocument.Parse(fetchXml); })); }
public async Task <SalesOrderListResponse> getlist(SalesOrderListRequest salesOrderListRequest) { try { var crmRequestHelper = new CrmRequestHelper(); var response = new SalesOrderListResponse() { }; XDocument fetchXdoc = null; fetchXdoc = await _salesorderRepository.GetListFetchXml(salesOrderListRequest); var entities = await crmRequestHelper.ExecuteAsync(_crmService, entityName, fetchXdoc); response.orders = entities.Results;; response.ALLTotalCount = entities.Count; response.PageSize = salesOrderListRequest.PageSize; response.CurrentPage = salesOrderListRequest.PageIndex; return(response); } catch (Exception ex) { throw ex; } }
public async Task <SalesOrderListResponse> getlist(SalesOrderListRequest salesOrderListRequest) { return(await _salesorderService.getlist(salesOrderListRequest)); }
public async Task <NewtonsoftJsonActionResult <SalesOrderListResponse> > getlist(SalesOrderListRequest salesOrderListRequest) { return(await _appSalesOrder.getlist(salesOrderListRequest)); }