public ServiceInfo GetServiceInfo() { //Get the operating enterprise terminal PermitServiceClient client = new PermitServiceClient(); try { return(client.GetServiceInfo()); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } }
public UserConfiguration GetUserConfiguration(string application, string[] usernames) { //Get the application configuration for the specified user UserConfiguration config = null; PermitServiceClient client = new PermitServiceClient(); try { config = client.GetUserConfiguration(application, usernames); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(config); }
public void WriteLogEntry(string message, Argix.HR.Permits.LogLevel level, string user) { //Write an entry into the Argix log PermitServiceClient client = new PermitServiceClient(); try { Argix.HR.Permits.TraceMessage m = new Argix.HR.Permits.TraceMessage(); m.Date = DateTime.Now; m.Name = "Argix10"; m.Source = "IDBadges"; m.User = user; m.Computer = Environment.MachineName; m.LogLevel = level; m.Message = message; client.WriteLogEntry(m); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } }