Advertisement
RyanFarley

Customer Portal Login

May 18th, 2018
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. public bool LoginToSLX(string username)
  2. {
  3.     try
  4.     {
  5.         var portalUser = Sage.SalesLogix.Security.PortalUser.GetPortalUser(username);
  6.  
  7.         var auditParams = new Auditing.AuditParams
  8.         {
  9.             AuditEvent = Auditing.AuditEvent.Login,
  10.             ContactId = portalUser.Contact.Id.ToString(),
  11.             UserName = username
  12.         };
  13.         new ContactAuditing().AddEvent(auditParams);
  14.  
  15.         FormsAuthentication.SetAuthCookie(username, true);
  16.  
  17.         return true;
  18.     }
  19.     catch (Exception ex)
  20.     {
  21.         Response.Write(ex.Message);
  22.         return false;
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement