/// <summary> /// Signs the customer into the backoffice. /// </summary> /// <param name="sessionID">A SessionID created by the Exigo web service's LoginCustomer method.</param> /// <returns>Whether or not the customer was successfully signed in.</returns> public bool SilentLogin(string sessionID) { var response = ExigoApiContext.CreateWebServiceContext().GetLoginSession(new GetLoginSessionRequest { SessionID = sessionID }); if (response.Result.Status == ResultStatus.Success && response.CustomerID > 0) { return(CreateFormsAuthenticationTicket(response.CustomerID)); } else { return(false); } }
/// <summary> /// Signs the customer into the backoffice. /// </summary> /// <param name="customerID">The customer's ID.</param> /// <param name="loginName">The customer's login name.</param> /// <returns>Whether or not the customer was successfully signed in.</returns> public bool SilentLogin(int customerID, string loginName) { var cust = (from c in ExigoApiContext.CreateODataContext().Customers where c.CustomerID == customerID where c.LoginName == loginName select new Backoffice.Exigo.OData.Customer { CustomerID = c.CustomerID }).FirstOrDefault(); if (cust != null) { return(CreateFormsAuthenticationTicket(cust.CustomerID)); } else { return(false); } }