Exemplo n.º 1
0
 public TenroxIdentity Authenticate(TenroxUser tenroxUser)
 {
     UserToken token;
     using (LogonAsClient client = new LogonAsClient(new BasicHttpBinding(BasicHttpSecurityMode.Transport), new EndpointAddress(_webserviceEndpoint)))
     {
         token = client.Authenticate("Intergen", tenroxUser.UserName, tenroxUser.Password, string.Empty, true);
     }
     return new TenroxIdentity(token.AuthenticatedGuid, token.UniqueId, token);
 }
Exemplo n.º 2
0
 public TimeSheet LoadCurrentTimesheet(TenroxUser tenroxUser)
 {
     TenroxIdentity token = _authenticator.Authenticate(tenroxUser);
     using (TimesheetsClient client = BuildTimeSheetsClient())
     {
         Timesheets timesheets = client.QueryByUserTyped(token.UserToken, token.UserId, DateTime.UtcNow.ToString("o"), 1, "", "");
         Timesheet currentTimeSheet = timesheets.MyTimesheets.First();
         return new TimeSheetBuilder(currentTimeSheet).Build();
     }
 }
Exemplo n.º 3
0
 public TenroxIdentity LoadIdentity(TenroxUser user)
 {
     return _cache.TryGetSet("TenroxIdentity", () => _authenticator.Authenticate(user));
 }