Profile Image Uploader
Overview
A simple application that allows the user to store and resize a primary and secondary image to their profile using the ASP.Net FileUpload.
Namespaces
This sample requires the following namespaces:
1 2 3 4 5 6 | using ExigoWebService; using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Net; using System.Text; |
Exigo API Authentication
This sample accesses the Exigo Web Service using the ExigoApi object:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | public ExigoApi Exigo { get { return new ExigoApi { ApiAuthenticationValue = new ApiAuthentication { LoginName = exigoAPILoginName, Password = exigoAPIPassword, Company = exigoAPICompany } }; } } |
Fetching Images by Customer ID
This sample fetches the primary and secondary image data with the current customer ID.
1 2 3 4 | return Exigo.GetCustomerSite( new GetCustomerSiteRequest { CustomerID = customerID }); |
Storing the Primary Image
This sample stores the primary image of the current customer to the Exigo API.
1 2 3 4 5 6 7 8 | SetCustomerSiteImageRequest req = new SetCustomerSiteImageRequest(); req.CustomerID = customerID; //Unique identifier for a customer entity. req.ImageName = picName; req.ImageData = file; req.CustomerSiteImageType = CustomerSiteImageType.Primary; SetCustomerSiteImageResponse res = Exigo.SetCustomerSiteImage(req); |
Storing the Secondary Image
This sample stores the secondary image of the current customer to the Exigo API.
1 2 3 4 5 6 7 8 | SetCustomerSiteImageRequest req = new SetCustomerSiteImageRequest(); req.CustomerID = customerID; //Unique identifier for a customer entity. req.ImageName = picName; req.ImageData = file; req.CustomerSiteImageType = CustomerSiteImageType.Secondary; SetCustomerSiteImageResponse res = Exigo.SetCustomerSiteImage(req); |