示例#1
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);
        }
示例#2
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);
        }