Beispiel #1
0
 public static void WriteLogEntry(TraceMessage m)
 {
     //Get the operating enterprise terminal
     try {
         _Client = new InvoicingServiceClient();
         _Client.WriteLogEntry(m);
         _Client.Close();
     }
     catch (FaultException fe) { throw new ApplicationException("WriteLogEntry() service error.", fe); }
     catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("WriteLogEntry() timeout error.", te); }
     catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("WriteLogEntry() communication error.", ce); }
 }
Beispiel #2
0
        public static Clients GetClients()
        {
            //Get client list
            Clients clients = null;

            try {
                _Client = new InvoicingServiceClient();
                clients = _Client.GetClients();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetClients() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetClients() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetClients() communication error.", ce); }
            return(clients);
        }
Beispiel #3
0
        public static TerminalInfo GetTerminalInfo()
        {
            //Get the operating enterprise terminal
            TerminalInfo terminal = null;

            try {
                _Client  = new InvoicingServiceClient();
                terminal = _Client.GetTerminalInfo();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetTerminalInfo() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetTerminalInfo() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetTerminalInfo() communication error.", ce); }
            return(terminal);
        }
Beispiel #4
0
        public static Invoices GetClientInvoices(string clientNumber, string clientDivision, string startDate)
        {
            //Get invoices for the specified client
            Invoices invoices = null;

            try {
                _Client  = new InvoicingServiceClient();
                invoices = _Client.GetClientInvoices(clientNumber, clientDivision, startDate);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetClientInvoices() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetClientInvoices() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetClientInvoices() communication error.", ce); }
            return(invoices);
        }
Beispiel #5
0
        public static UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the operating enterprise terminal
            UserConfiguration config = null;

            try {
                _Client = new InvoicingServiceClient();
                config  = _Client.GetUserConfiguration(application, usernames);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetUserConfiguration() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetUserConfiguration() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetUserConfiguration() communication error.", ce); }
            return(config);
        }
Beispiel #6
0
        public static void WriteLogEntry(TraceMessage m)
        {
            //Get the operating enterprise terminal
            InvoicingServiceClient client = null;

            try {
                client = new InvoicingServiceClient();
                client.WriteLogEntry(m);
                client.Close();
            }
            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); }
        }
Beispiel #7
0
        public static UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the operating enterprise terminal
            UserConfiguration      config = null;
            InvoicingServiceClient client = null;

            try {
                client = new InvoicingServiceClient();
                config = client.GetUserConfiguration(application, usernames);
                client.Close();
            }
            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);
        }
Beispiel #8
0
        public static ServiceInfo GetServiceInfo()
        {
            //Get the operating enterprise terminal
            ServiceInfo            terminal = null;
            InvoicingServiceClient client   = null;

            try {
                client   = new InvoicingServiceClient();
                terminal = client.GetServiceInfo();
                client.Close();
            }
            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(terminal);
        }
Beispiel #9
0
        public static InvoicingDataset GetClients()
        {
            //Get client list
            InvoicingDataset       clients = new InvoicingDataset();
            InvoicingServiceClient client  = null;

            try {
                client = new InvoicingServiceClient();
                DataSet ds = client.GetClients();
                if (ds.Tables["ClientTable"] != null && ds.Tables["ClientTable"].Rows.Count > 0)
                {
                    clients.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <InvoicingFault> 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(clients);
        }
Beispiel #10
0
        public static InvoicingDataset GetClientInvoices(string clientNumber, string clientDivision, string startDate)
        {
            //Get invoices for the specified client
            InvoicingDataset       invoices = new InvoicingDataset();
            InvoicingServiceClient client   = null;

            try {
                client = new InvoicingServiceClient();
                DataSet ds = client.GetClientInvoices(clientNumber, clientDivision, startDate);
                if (ds.Tables["ClientInvoiceTable"] != null && ds.Tables["ClientInvoiceTable"].Rows.Count > 0)
                {
                    invoices.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <InvoicingFault> 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(invoices);
        }