示例#1
0
 //Interface
 public BadgeGateway()
 {
     //
     Argix.HR.BadgeServiceClient client = new BadgeServiceClient();
     _state   = true;
     _address = client.Endpoint.Address.Uri.AbsoluteUri;
 }
示例#2
0
        public ServiceInfo GetServiceInfo()
        {
            //Get the operating enterprise terminal
            BadgeServiceClient client = new BadgeServiceClient();

            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); }
        }
示例#3
0
        public UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the application configuration for the specified user
            UserConfiguration  config = null;
            BadgeServiceClient client = new BadgeServiceClient();

            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);
        }
示例#4
0
        public void WriteLogEntry(string message, Argix.HR.LogLevel level, string user)
        {
            //Write an entry into the Argix log
            BadgeServiceClient client = new BadgeServiceClient();

            try {
                Argix.HR.TraceMessage m = new Argix.HR.TraceMessage();
                m.Date     = DateTime.Now;
                m.Name     = "Argix10";
                m.Source   = "Argix10.IDBadges.Web";
                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); }
        }