Ejemplo 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);
        }
Ejemplo n.º 2
0
 //Interface
 static DeliveryPointsProxy()
 {
     //
     _Client  = new DeliveryPointsServiceClient();
     _state   = true;
     _address = _Client.Endpoint.Address.Uri.AbsoluteUri;
 }
Ejemplo n.º 3
0
        //Interface
        static TerminalsGateway()
        {
            //
            DeliveryPointsServiceClient client = new DeliveryPointsServiceClient();

            _state   = true;
            _address = client.Endpoint.Address.Uri.AbsoluteUri;
        }
Ejemplo n.º 4
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); }
 }
Ejemplo n.º 5
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); }
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
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);
        }
Ejemplo n.º 11
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);
        }
Ejemplo n.º 12
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);
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
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);
        }
Ejemplo n.º 15
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);
        }