本文整理汇总了C#中XrmServiceContext.RetrieveMultiple方法的典型用法代码示例。如果您正苦于以下问题:C# XrmServiceContext.RetrieveMultiple方法的具体用法?C# XrmServiceContext.RetrieveMultiple怎么用?C# XrmServiceContext.RetrieveMultiple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XrmServiceContext
的用法示例。
在下文中一共展示了XrmServiceContext.RetrieveMultiple方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTree
public CreateTree(XrmServiceContext context, Guid userGuid)
{
string fetchxml = "<fetch>"+
"<entity name='expl_obecnasiec' >" +
"<attribute name='expl_dyrektorregionu' />"+
"<attribute name='expl_dyrektor' />"+
"<attribute name='expl_koordynator' />"+
"<attribute name='expl_konsultant' />" +
"<order attribute='expl_dyrektorregionu' descending='true' />" +
"<order attribute='expl_dyrektor' descending='true' />" +
"<order attribute='expl_koordynator' descending='true' />" +
"<order attribute='expl_konsultant' descending='true' />" +
"<filter type='or' >" +
"<condition entityname='Konsultant' attribute='contactid' operator='eq' value='" + userGuid + "' />"+
"<condition entityname='Koordynator' attribute='contactid' operator='eq' value='" + userGuid + "' /> "+
"<condition entityname = 'Dyrektor' attribute ='contactid' operator= 'eq' value = '" + userGuid + "' />"+
"<condition entityname='DyrektorRegionu' attribute='contactid' operator='eq' value='" + userGuid + "' />"+
"</filter>"+
"<link-entity name='expl_pracownik' from='expl_pracownikid' to='expl_konsultant' alias='a_konsultant' >"+
"<attribute name='expl_name' />" +
"<attribute name='expl_pracownikid' />" +
"<link-entity name='contact' from='contactid' to='expl_kontakt' alias='Konsultant' >" +
"<attribute name='contactid' alias='KonsultantID' />"+
"</link-entity>"+
"</link-entity>"+
"<link-entity name = 'expl_koordynator' from = 'expl_koordynatorid' to = 'expl_koordynator' alias='a_koordynator' >"+
"<attribute name='expl_name' />" +
"<attribute name='expl_koordynatorid' />" +
"<link-entity name = 'contact' from = 'contactid' to = 'expl_kontakt' alias = 'Koordynator' >" +
"<attribute name='contactid' alias='KoordynatorID' />"+
"</link-entity>"+
"</link-entity>"+
"<link-entity name='expl_dyrektorsprzedzay' from = 'expl_dyrektorsprzedzayid' to='expl_dyrektor' alias='a_dyrektor' >"+
"<attribute name='expl_name' />" +
"<attribute name='expl_dyrektorsprzedzayid' />" +
"<link-entity name='contact' from='contactid' to='expl_kontakt' alias='Dyrektor' >" +
"<attribute name='contactid' alias='DyrektorID' />"+
"</link-entity>"+
"</link-entity>"+
"<link-entity name='expl_dyrektorregionu' from='expl_dyrektorregionuid' to='expl_dyrektorregionu' alias='a_dyrektorregionu' >" +
"<attribute name='expl_name' />" +
"<attribute name='expl_dyrektorregionuid' />" +
"<link-entity name='contact' from='contactid' to='expl_kontakt' alias='DyrektorRegionu' >" +
"<attribute name='contactid' alias='DyrektorRegionuID' />"+
"</link-entity>"+
"</link-entity>"+
"</entity>"+
"</fetch>";
#region oldxml
//string fetchxml =
//@"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' >" +
//"<entity name='expl_obecnasiec' >" +
//"<attribute name='createdon' />" +
//"<attribute name='expl_koordynator' />" +
//"<attribute name='expl_konsultant' />" +
//"<attribute name='expl_dyrektor' />" +
//"<attribute name='expl_dyrektorregionu' />" +
//"<attribute name='expl_obecnasiecid' />" +
//"<order attribute='expl_dyrektorregionu' descending='true' />" +
//"<order attribute='expl_dyrektor' descending='true' />" +
//"<order attribute='expl_koordynator' descending='true' />" +
//"<filter type='and' >" +
//"<condition attribute='statecode' operator='eq' value='0' />" +
//"</filter>" +
//"<link-entity name='expl_pracownik' from='expl_pracownikid' to='expl_konsultant' visible='false' link-type='outer' alias='a_konsultant'>" +
//"<attribute name='expl_name' />" +
//"<attribute name='expl_pracownikid' />" +
//"<attribute name='expl_kontakt' />" +
//"</link-entity> " +
//"<link-entity name='expl_koordynator' from='expl_koordynatorid' to='expl_koordynator' visible='false' link-type='outer' alias='a_koordynator' >" +
//"<attribute name='expl_name' />" +
//"<attribute name='expl_koordynatorid' />" +
//"<attribute name='expl_kontakt' />" +
//"</link-entity>" +
//"<link-entity name='expl_dyrektorsprzedzay' from='expl_dyrektorsprzedzayid' to='expl_dyrektor' visible='false' link-type='outer' alias='a_dyrektor' >" +
//"<attribute name='expl_name' />" +
//"<attribute name='expl_dyrektorsprzedzayid' />" +
//"<attribute name='expl_kontakt' />" +
//"</link-entity>" +
//"<link-entity name='expl_dyrektorregionu' from='expl_dyrektorregionuid' to='expl_dyrektorregionu' visible='false' link-type='outer' alias='a_dyrektorregionu' >" +
//"<attribute name='expl_name' />" +
//"<attribute name='expl_dyrektorregionuid' />" +
//"<attribute name='expl_kontakt' />" +
//"</link-entity>" +
//"</entity ></fetch>";
#endregion oldxml
EntityCollection result = context.RetrieveMultiple(new FetchExpression(fetchxml));
if(result.Entities.Count == 0)
{
_html = "";
return;
}
string currentAreaDirector = null;
string currentSalesDirector = null;
string currentCoordinator = null;
//.........这里部分代码省略.........