Customer Wall
Overview
The customer wall displays customer's downline's events that have occurred based on custom commission engine triggers, such as someone's rank changing or a new enrollment.
Namespaces
This sample requires the following namespaces:
using ExigoOData; using System.Data.Services.Client; using System.Text;
Exigo API Authentication
This sample accesses OData using the ExigoContext object:
public ExigoContext Exigo { get { var context = new ExigoOData.ExigoContext(new Uri("http://api.exigo.com/4.0/" + exigoAPICompany + "/model")); context.IgnoreMissingProperties = true; var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(exigoAPILoginName + ":" + exigoAPIPassword)); context.SendingRequest += (object s, SendingRequestEventArgs e) => e.RequestHeaders.Add("Authorization", "Basic " + credentials); return context; } }
Client-Side Events
Links can be generated around key pieces of information in your events, such as customer ID's and names. These client-side links will use onClick events to call a javascript function that should accept a unique identifier for it's context. This sample contains links that call a javascript function called "c", which accepts a variable "id" representing the customer's ID:
<script type="text/javascript" language="javascript"> function c(id) { alert("You clicked customer ID " + id); } </script>
Fetching Customer Wall Details
To fetch customer wall details, use the OData's CustomerWall query:
return (from c in Exigo.CustomerWall where c.CustomerID == customerID orderby c.WallItemID descending select new WallItem() { CustomerID = c.CustomerID, EntryDate = c.EntryDate, Text = c.Text, Field1 = c.Field1, Field2 = c.Field2 }).Take(maxWallItemsCount).ToList();