Adxstudio.Xrm.Web.UI.WebForms.CrmSessionHistoryProvider.GetSessionHistory(Microsoft.Xrm.Sdk.Entity)

Here are the examples of the csharp api class Adxstudio.Xrm.Web.UI.WebForms.CrmSessionHistoryProvider.GetSessionHistory(Microsoft.Xrm.Sdk.Entity) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

1. Example

Project: xRM-Portals-Community-Edition
Source File: CrmSessionHistoryProvider.cs
public SessionHistory GetSessionHistory(OrganizationServiceContext context, Guid sessionID)
		{
			if (context == null)
			{
				throw new ArgumentNullException("context");
			}

			var webFormSession = context.CreateQuery("adx_webformsession").FirstOrDefault(s => s.GetAttributeValue<OptionSetValue>("statecode") != null && s.GetAttributeValue<OptionSetValue>("statecode").Value == 0 && s.GetAttributeValue<Guid>("adx_webformsessionid") == sessionID);

			return GetSessionHistory(webFormSession);
		}

2. Example

Project: xRM-Portals-Community-Edition
Source File: CrmSessionHistoryProvider.cs
public SessionHistory GetSessionHistoryByPrimaryRecord(OrganizationServiceContext context, Guid webFormId, Guid recordId)
		{
			if (context == null)
			{
				throw new ArgumentNullException("context");
			}

			var webFormSession = context.CreateQuery("adx_webformsession").FirstOrDefault(s => s.GetAttributeValue<OptionSetValue>("statecode") != null && s.GetAttributeValue<OptionSetValue>("statecode").Value == 0 && s.GetAttributeValue<EntityReference>("adx_webform") == new EntityReference("adx_webform", webFormId) && s.GetAttributeValue<string>("adx_primaryrecordid") == recordId.ToString());

			return GetSessionHistory(webFormSession);
		}

3. Example

Project: xRM-Portals-Community-Edition
Source File: CrmSessionHistoryProvider.cs
public SessionHistory GetSessionHistoryByContact(OrganizationServiceContext context, Guid webFormId, Guid contactId)
		{
			if (context == null)
			{
				throw new ArgumentNullException("context");
			}

			var webFormSession = context.CreateQuery("adx_webformsession").Where(s => s.GetAttributeValue<OptionSetValue>("statecode") != null && s.GetAttributeValue<OptionSetValue>("statecode").Value == 0).OrderByDescending(s => s.GetAttributeValue<DateTime>("modifiedon")).FirstOrDefault(s => s.GetAttributeValue<EntityReference>("adx_webform") == new EntityReference("adx_webform", webFormId) && s.GetAttributeValue<EntityReference>("adx_contact") == new EntityReference("contact", contactId));

			return GetSessionHistory(webFormSession);
		}

4. Example

Project: xRM-Portals-Community-Edition
Source File: CrmSessionHistoryProvider.cs
public SessionHistory GetSessionHistoryBySystemUser(OrganizationServiceContext context, Guid webFormId, Guid systemUserId)
		{
			if (context == null)
			{
				throw new ArgumentNullException("context");
			}

			var webFormSession = context.CreateQuery("adx_webformsession").Where(s => s.GetAttributeValue<OptionSetValue>("statecode") != null && s.GetAttributeValue<OptionSetValue>("statecode").Value == 0).OrderByDescending(s => s.GetAttributeValue<DateTime>("modifiedon")).FirstOrDefault(s => s.GetAttributeValue<EntityReference>("adx_webform") == new EntityReference("adx_webform", webFormId) && s.GetAttributeValue<EntityReference>("adx_systemuser") == new EntityReference("systemuser", systemUserId));

			return GetSessionHistory(webFormSession);
		}

5. Example

Project: xRM-Portals-Community-Edition
Source File: CrmSessionHistoryProvider.cs
public SessionHistory GetSessionHistoryByUserIdentityName(OrganizationServiceContext context, Guid webFormId, string userIdentityName)
		{
			if (context == null)
			{
				throw new ArgumentNullException("context");
			}

			var webFormSession = context.CreateQuery("adx_webformsession").Where(s => s.GetAttributeValue<OptionSetValue>("statecode") != null && s.GetAttributeValue<OptionSetValue>("statecode").Value == 0).OrderByDescending(s => s.GetAttributeValue<DateTime>("modifiedon")).FirstOrDefault(s => s.GetAttributeValue<EntityReference>("adx_webform") == new EntityReference("adx_webform", webFormId) && s.GetAttributeValue<string>("adx_useridentityname") == userIdentityName);

			return GetSessionHistory(webFormSession);
		}

6. Example

Project: xRM-Portals-Community-Edition
Source File: CrmSessionHistoryProvider.cs
public SessionHistory GetSessionHistoryByAnonymousIdentification(OrganizationServiceContext context, Guid webFormId, string anonymousIdentification)
		{
			if (context == null)
			{
				throw new ArgumentNullException("context");
			}

			var webFormSession = context.CreateQuery("adx_webformsession").Where(s => s.GetAttributeValue<OptionSetValue>("statecode") != null && s.GetAttributeValue<OptionSetValue>("statecode").Value == 0).OrderByDescending(s => s.GetAttributeValue<DateTime>("modifiedon")).FirstOrDefault(s => s.GetAttributeValue<EntityReference>("adx_webform") == new EntityReference("adx_webform", webFormId) && s.GetAttributeValue<string>("adx_anonymousidentification") == anonymousIdentification);

			return GetSessionHistory(webFormSession);
		}