Site Service Integration

Integrating your system can also be made by overriding the existing Site Service functionality. Every method in Site Service is marked as virtual, thus allowing anything to be overridden, providing access to the following:

  • Items
  • Items hierarchy
  • Customers
  • Sales information
  • End of day statements
  • Cash management information
  • Inventory

Overriding Site Service methods

To override the existing methods, you need to create your own plugin that extends the existing SiteManagerPlugin from the Site Service solution and simply override the desired methods.

By including the DLL file of your new plugin containing the overridden methods, the application will automatically know that those methods have been overridden and use your plugin instead of the default one.


	namespace SiteManagerPlugin.Inventory
	{
		public class OnHandInventory : LSOne.SiteService.Plugins.SiteManager.SiteManagerPlugin
		{
			public override List<InventoryStatus> GetInventoryStatus(
					RecordIdentifier itemID,
					RecordIdentifier variantID,
					LogonInfo logonInfo)
			{
				List<InventoryStatus> onHandInventory = new List<InventoryStatus>();
				
				//If the item is a Briefcase then add 100 to any on hand inventory that already exists
				if(itemID == "50000")
				{
					onHandInventory = base.GetInventoryStatus(itemID, variantID, logonInfo);
					
					foreach(InventoryStatus status in onHandInventory)
					{
						status.InventoryQuantity += 100;
					}
					
					//Return the changed inventory status
					return onHandInventory;
				}
				
				//For any other item return the actual inventory status
				return base.GetInventoryStatus(itemID, variantID, logonInfo);
			}
		}
	}
		

In the above example we are overriding the GetInventoryStatus method, and if the item for which we are get the inventory status is a briefcase, we increase it's quantity on each store by 100. For any other item, we use the base functionality.

You can also see that our class extend the SiteManagerPlugin which contains all default method implementations.