Esempio n. 1
0
        public static DeliveryPointsDataset GetCustomers()
        {
            //Get roadshow customers
            DeliveryPointsDataset       customers = null;
            DeliveryPointsServiceClient client    = new DeliveryPointsServiceClient();

            try {
                ObjectCache cache = MemoryCache.Default;
                customers = cache["customers"] as DeliveryPointsDataset;
                if (customers == null)
                {
                    customers = new DeliveryPointsDataset();
                    DataSet ds = client.GetRoadshowCustomers();
                    if (ds != null)
                    {
                        customers.Merge(ds);
                    }
                    client.Close();

                    DateTimeOffset policy = new DateTimeOffset(DateTime.Now.AddMinutes(_cacheTimeout));
                    cache.Set("customers", customers, policy);
                }
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RoadshowFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(customers);
        }
Esempio n. 2
0
 public static void WriteLogEntry(TraceMessage m)
 {
     //Get the operating enterprise terminal
     try {
         _Client = new DeliveryPointsServiceClient();
         _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); }
 }
Esempio n. 3
0
        public static void WriteLogEntry(TraceMessage m)
        {
            //Get the operating enterprise terminal
            DeliveryPointsServiceClient client = new DeliveryPointsServiceClient();

            try {
                client.WriteLogEntry(m);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
        }
Esempio n. 4
0
        public static DeliveryPoints GetDeliveryPoints(DateTime startDate, DateTime lastUpated)
        {
            //Get delivery points
            DeliveryPoints points = null;

            try {
                _Client = new DeliveryPointsServiceClient();
                points  = _Client.GetDeliveryPoints(startDate, lastUpated);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetDeliveryPoints() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetDeliveryPoints() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetDeliveryPoints() communication error.", ce); }
            return(points);
        }
Esempio n. 5
0
        public static TerminalInfo GetTerminalInfo()
        {
            //Get the operating enterprise terminal
            TerminalInfo terminal = null;

            try {
                _Client  = new DeliveryPointsServiceClient();
                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);
        }
Esempio n. 6
0
        public static UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the operating enterprise terminal
            UserConfiguration config = null;

            try {
                _Client = new DeliveryPointsServiceClient();
                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);
        }
Esempio n. 7
0
        public static bool UpdateExportDate(DateTime lastUpdated)
        {
            //Update the latest delivery point LastUpdated date from the last export
            bool updated = false;

            try {
                _Client = new DeliveryPointsServiceClient();
                updated = _Client.UpdateExportDate(lastUpdated);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("UpdateExportDate() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("UpdateExportDate() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("UpdateExportDate() communication error.", ce); }
            return(updated);
        }
Esempio n. 8
0
        public static DateTime GetExportDate()
        {
            //Get the latest delivery point LastUpdated date from the last export
            DateTime date = DateTime.Now;

            try {
                _Client = new DeliveryPointsServiceClient();
                date    = _Client.GetExportDate();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetExportDate() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetExportDate() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetExportDate() communication error.", ce); }
            return(date);
        }
Esempio n. 9
0
        public static ServiceInfo GetServiceInfo()
        {
            //Get the operating enterprise terminal
            ServiceInfo terminal = null;
            DeliveryPointsServiceClient client = new DeliveryPointsServiceClient();

            try {
                terminal = client.GetServiceInfo();
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(terminal);
        }
Esempio n. 10
0
        public static UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the operating enterprise terminal
            UserConfiguration           config = null;
            DeliveryPointsServiceClient client = new DeliveryPointsServiceClient();

            try {
                config = client.GetUserConfiguration(application, usernames);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(config);
        }
Esempio n. 11
0
        public static bool UpdateExportDate(DateTime lastUpdated)
        {
            //Update the latest delivery point LastUpdated date from the last export
            bool updated = false;
            DeliveryPointsServiceClient client = new DeliveryPointsServiceClient();

            try {
                updated = client.UpdateExportDate(lastUpdated);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <TerminalsFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(updated);
        }
Esempio n. 12
0
        public static DateTime GetExportDate()
        {
            //Get the latest delivery point LastUpdated date from the last export
            DateTime date = DateTime.Now;
            DeliveryPointsServiceClient client = new DeliveryPointsServiceClient();

            try {
                date = client.GetExportDate();
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <TerminalsFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(date);
        }
Esempio n. 13
0
        public static DeliveryPointsDataset GetDeliveryPoints(DateTime startDate, DateTime lastUpated)
        {
            //Get delivery points
            DeliveryPointsDataset       points = new DeliveryPointsDataset();
            DeliveryPointsServiceClient client = new DeliveryPointsServiceClient();

            try {
                DataSet ds = client.GetDeliveryPoints(startDate, lastUpated);
                if (ds != null)
                {
                    points.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <TerminalsFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(points);
        }