コード例 #1
0
ファイル: RoadshowGateway.cs プロジェクト: jpheary/Argix10
        public static Customers GetCustomers()
        {
            //Get carriers list
            Customers customers = null;

            try {
                ObjectCache cache = MemoryCache.Default;
                customers = cache["customers"] as Customers;
                if (customers == null)
                {
                    _Client   = new RoadshowServiceClient();
                    customers = _Client.GetCustomers();
                    _Client.Close();

                    //CacheItemPolicy policy = new CacheItemPolicy();
                    //policy.ChangeMonitors.Add(new SqlChangeMonitor(new SqlDependency()));
                    DateTimeOffset policy = new DateTimeOffset(DateTime.Now.AddMinutes(30));
                    cache.Set("customers", customers, policy);
                }
            }
            catch (FaultException fe) { throw new ApplicationException("GetCustomers() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetCustomers() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetCustomers() communication error.", ce); }
            return(customers);
        }
コード例 #2
0
ファイル: RoadshowGateway.cs プロジェクト: jpheary/Argix08
 //Interface
 static RoadshowGateway()
 {
     //
     _Client  = new RoadshowServiceClient();
     _state   = true;
     _address = _Client.Endpoint.Address.Uri.AbsoluteUri;
 }
コード例 #3
0
ファイル: TerminalGateway.cs プロジェクト: jpheary/Argix10
        public static Customers GetCustomers()
        {
            //Get customers list
            Customers             customers = null;
            RoadshowServiceClient client    = new RoadshowServiceClient();

            try {
                ObjectCache cache = MemoryCache.Default;
                customers = cache["customers"] as Customers;
                if (customers == null)
                {
                    customers = client.GetCustomers();
                    client.Close();

                    //CacheItemPolicy policy = new CacheItemPolicy();
                    //policy.ChangeMonitors.Add(new SqlChangeMonitor(new SqlDependency()));
                    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> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(customers);
        }
コード例 #4
0
ファイル: TerminalGateway.cs プロジェクト: jpheary/Argix10
 //Interface
 static TerminalGateway()
 {
     //
     try {
         RoadshowServiceClient client = new RoadshowServiceClient();
         _state        = true;
         _address      = client.Endpoint.Address.Uri.AbsoluteUri;
         _cacheTimeout = global::Argix.Properties.Settings.Default.CacheTimeout;
     }
     catch (Exception ex) { App.ReportError(ex, true, Argix.Freight.LogLevel.Error); }
 }
コード例 #5
0
 public static void WriteLogEntry(TraceMessage m)
 {
     //Get the operating enterprise terminal
     try {
         _Client = new RoadshowServiceClient();
         _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); }
 }
コード例 #6
0
 public static void LoadScanAudit(DateTime routeDate, string routeClass)
 {
     //Load scan audit data
     try {
         _Client = new RoadshowServiceClient();
         _Client.LoadScanAudit(routeDate, routeClass);
         _Client.Close();
     }
     catch (FaultException fe) { throw new ApplicationException("LoadScanAudit() service error.", fe); }
     catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("LoadScanAudit() timeout error.", te); }
     catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("LoadScanAudit() communication error.", ce); }
 }
コード例 #7
0
        public static bool CanLoadScanAudit(DateTime routeDate, string routeClass)
        {
            bool ret = false;

            try {
                _Client = new RoadshowServiceClient();
                ret     = _Client.CanLoadScanAudit(routeDate, routeClass);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("CanLoadScanAudit() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("CanLoadScanAudit() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("CanLoadScanAudit() communication error.", ce); }
            return(ret);
        }
コード例 #8
0
        public static Depots GetDepots(string terminalCode)
        {
            //
            Depots depots = null;

            try {
                _Client = new RoadshowServiceClient();
                depots  = _Client.GetDepots(terminalCode);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetDepots() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetDepots() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetDepots() communication error.", ce); }
            return(depots);
        }
コード例 #9
0
        public static bool AddPickup(Pickup pickup)
        {
            //
            bool ret = false;

            try {
                _Client = new RoadshowServiceClient();
                ret     = _Client.AddPickup(pickup);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("AddPickup() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("AddPickup() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("AddPickup() communication error.", ce); }
            return(ret);
        }
コード例 #10
0
        public static Pickups GetPickups(DateTime pickupDate, string routeClass)
        {
            //
            Pickups pickups = null;

            try {
                _Client = new RoadshowServiceClient();
                pickups = _Client.GetPickups(pickupDate, routeClass);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetPickups() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetPickups() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetPickups() communication error.", ce); }
            return(pickups);
        }
コード例 #11
0
        public static TerminalInfo GetTerminalInfo()
        {
            //Get the operating enterprise terminal
            TerminalInfo terminal = null;

            try {
                _Client  = new RoadshowServiceClient();
                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);
        }
コード例 #12
0
        public static Drivers GetScanAuditDrivers(DateTime routeDate, string routeClass)
        {
            //
            Drivers drivers = null;

            try {
                _Client = new RoadshowServiceClient();
                drivers = _Client.GetScanAuditDrivers(routeDate, routeClass);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetScanAuditDrivers() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetScanAuditDrivers() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetScanAuditDrivers() communication error.", ce); }
            return(drivers);
        }
コード例 #13
0
        public static OnTimeIssues GetOnTimeIssues()
        {
            //
            OnTimeIssues issues = null;

            try {
                _Client = new RoadshowServiceClient();
                issues  = _Client.GetOnTimeIssues();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetOnTimeIssues() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetOnTimeIssues() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetOnTimeIssues() communication error.", ce); }
            return(issues);
        }
コード例 #14
0
        public static UpdateUsers GetUpdateUsers(string routeClass)
        {
            //
            UpdateUsers users = null;

            try {
                _Client = new RoadshowServiceClient();
                users   = _Client.GetUpdateUsers(routeClass);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetUpdateUsers() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetUpdateUsers() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetUpdateUsers() communication error.", ce); }
            return(users);
        }
コード例 #15
0
        public static Customers GetCustomers()
        {
            //
            Customers customers = null;

            try {
                _Client   = new RoadshowServiceClient();
                customers = _Client.GetCustomers();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetCustomers() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetCustomers() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetCustomers() communication error.", ce); }
            return(customers);
        }
コード例 #16
0
        public static bool UpdateScanAudit(ScanAudit scan)
        {
            //
            bool ret = false;

            try {
                _Client = new RoadshowServiceClient();
                ret     = _Client.UpdateScanAudit(scan);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("UpdateScanAudit() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("UpdateScanAudit() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("UpdateScanAudit() communication error.", ce); }
            return(ret);
        }
コード例 #17
0
        public static UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the operating enterprise terminal
            UserConfiguration config = null;

            try {
                _Client = new RoadshowServiceClient();
                System.ComponentModel.BindingList <string> names = new System.ComponentModel.BindingList <string>(usernames);
                config = _Client.GetUserConfiguration(application, names);
                _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);
        }
コード例 #18
0
ファイル: TerminalGateway.cs プロジェクト: jpheary/Argix10
        public static Drivers GetDrivers(int depotNumber)
        {
            //Get drivers list
            Drivers drivers = null;
            RoadshowServiceClient client = new RoadshowServiceClient();

            try {
                drivers = client.GetDrivers(depotNumber);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RoadshowFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(drivers);
        }
コード例 #19
0
ファイル: RoadshowGateway.cs プロジェクト: jpheary/Argix10
        public static Drivers GetDrivers(int depotNumber)
        {
            //Get drivers list
            Drivers drivers = null;

            try {
                _Client = new RoadshowServiceClient();
                drivers = _Client.GetDrivers(depotNumber);
                _Client.Close();

                Driver driver = new Driver();
                driver.Name = "All";
                drivers.Insert(0, driver);
            }
            catch (FaultException fe) { throw new ApplicationException("GetDrivers() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetDrivers() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetDrivers() communication error.", ce); }
            return(drivers);
        }
コード例 #20
0
ファイル: RoadshowGateway.cs プロジェクト: jpheary/Argix08
        public static RoadshowDS GetCustomers()
        {
            //Get roadshow customers
            RoadshowDS customers = null;

            try {
                customers = new RoadshowDS();

                _Client = new RoadshowServiceClient();
                DataSet ds = _Client.GetCustomers();
                _Client.Close();

                if (ds != null)
                {
                    customers.Merge(ds);
                }
            }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException fe) { _Client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException(ce.Message); }
            return(customers);
        }
コード例 #21
0
ファイル: RoadshowGateway.cs プロジェクト: jpheary/Argix10
        public static Depots GetDepots()
        {
            //Get depots list
            Depots depots = null;

            try {
                ObjectCache cache = MemoryCache.Default;
                depots = cache["depots"] as Depots;
                if (depots == null)
                {
                    _Client = new RoadshowServiceClient();
                    depots  = _Client.GetDepots();
                    _Client.Close();

                    DateTimeOffset policy = new DateTimeOffset(DateTime.Now.AddMinutes(1));
                    cache.Set("depots", depots, policy);
                }
            }
            catch (FaultException fe) { throw new ApplicationException("GetDepots() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetDepots() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetDepots() communication error.", ce); }
            return(depots);
        }
コード例 #22
0
ファイル: TerminalGateway.cs プロジェクト: jpheary/Argix10
        public static Depots GetDepots()
        {
            //Get depots list
            Depots depots = null;
            RoadshowServiceClient client = new RoadshowServiceClient();

            try {
                ObjectCache cache = MemoryCache.Default;
                depots = cache["depots"] as Depots;
                if (depots == null)
                {
                    depots = client.GetDepots();
                    client.Close();

                    DateTimeOffset policy = new DateTimeOffset(DateTime.Now.AddMinutes(_cacheTimeout));
                    cache.Set("depots", depots, policy);
                }
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RoadshowFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(depots);
        }