Ejemplo n.º 1
0
        public TerminalDataset GetTerminals()
        {
            //Get a list of Argix terminals
            TerminalDataset    terminals = new TerminalDataset();
            TsortServiceClient client    = new TsortServiceClient();

            try {
                DataSet ds = client.GetTerminals();
                if (ds != null)
                {
                    TerminalDataset ts = new TerminalDataset();
                    ts.Merge(ds);
                    if (HttpContext.Current.User.Identity.Name != "jheary")
                    {
                        string codes = ConfigurationManager.AppSettings["Terminals"];
                        for (int i = ts.TerminalTable.Rows.Count - 1; i >= 0; i--)
                        {
                            if (!codes.Contains(ts.TerminalTable[i].Number))
                            {
                                ts.TerminalTable[i].Delete();
                            }
                        }
                    }
                    terminals.Merge(ts);
                }
                client.Close();
            }
            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(terminals);
        }
Ejemplo n.º 2
0
 //Interface
 static FreightProxy()
 {
     //
     _Client = new TsortServiceClient();
     _Client.InnerChannel.Opening += new EventHandler(OnStateChanged);
     _Client.InnerChannel.Opened  += new EventHandler(OnStateChanged);
     _Client.InnerChannel.Closing += new EventHandler(OnStateChanged);
     _Client.InnerChannel.Closed  += new EventHandler(OnStateChanged);
     _Client.InnerChannel.Faulted += new EventHandler(OnStateChanged);
     _Client.InnerChannel.UnknownMessageReceived += new EventHandler <System.ServiceModel.UnknownMessageReceivedEventArgs>(OnUnknownMessageReceived);
 }
Ejemplo n.º 3
0
        //Interface
        static TsortGateway()
        {
            //
            _Zones = new FreightDataset();
            _TLs   = new FreightDataset();

            TsortServiceClient client = new TsortServiceClient();

            _state   = true;
            _address = client.Endpoint.Address.Uri.AbsoluteUri;
        }
Ejemplo n.º 4
0
        //Interface
        static TsortGateway()
        {
            //
            _InboundFreight    = new TsortDataset();
            _Assignments       = new TsortDataset();
            _AssignmentHistory = new TsortDataset();

            TsortServiceClient client = new TsortServiceClient();

            _state             = true;
            _address           = client.Endpoint.Address.Uri.AbsoluteUri;
            _AssignmentHistory = new TsortDataset();
        }
Ejemplo n.º 5
0
        public TerminalDataset GetTerminals()
        {
            //Get a list of Argix terminals
            TerminalDataset    terminals = new TerminalDataset();
            TsortServiceClient client    = new TsortServiceClient();

            try {
                DataSet ds = client.GetTerminals();
                if (ds != null)
                {
                    TerminalDataset ts = new TerminalDataset();
                    if (HttpContext.Current.User.Identity.Name.ToLower() == "chicago")
                    {
                        ts.TerminalTable.AddTerminalTableRow(0, "29", "CHICAGO", "0", "0", "0", "01", 1);
                    }
                    else if (HttpContext.Current.User.Identity.Name.ToLower() == "columbus")
                    {
                        ts.TerminalTable.AddTerminalTableRow(0, "65", "COLUMBUS", "0", "0", "0", "01", 1);
                    }
                    else if (HttpContext.Current.User.Identity.Name.ToLower() == "dallas")
                    {
                        ts.TerminalTable.AddTerminalTableRow(0, "55", "DALLAS", "0", "0", "0", "01", 1);
                    }
                    else if (HttpContext.Current.User.Identity.Name.ToLower() == "losangeles")
                    {
                        ts.TerminalTable.AddTerminalTableRow(0, "11", "LOS ANGELES", "0", "0", "0", "01", 1);
                    }
                    else
                    {
                        ts.Merge(ds);
                        if (HttpContext.Current.User.Identity.Name != "jheary")
                        {
                            string codes = ConfigurationManager.AppSettings["Terminals"];
                            for (int i = ts.TerminalTable.Rows.Count - 1; i >= 0; i--)
                            {
                                if (!codes.Contains(ts.TerminalTable[i].Number))
                                {
                                    ts.TerminalTable[i].Delete();
                                }
                            }
                        }
                    }
                    terminals.Merge(ts);
                }
                client.Close();
            }
            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(terminals);
        }
Ejemplo n.º 6
0
        public static void WriteLogEntry(TraceMessage m)
        {
            //Get the operating enterprise terminal
            TsortServiceClient client = new TsortServiceClient();

            try {
                client.WriteLogEntry(int.Parse(Program.TerminalCode), m);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> efe) { client.Abort(); throw new ApplicationException(efe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
        }
Ejemplo n.º 7
0
        public static UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the operating enterprise terminal
            UserConfiguration  config = null;
            TsortServiceClient client = new TsortServiceClient();

            try {
                config = client.GetUserConfiguration(int.Parse(Program.TerminalCode), application, usernames);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> efe) { client.Abort(); throw new ApplicationException(efe.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.º 8
0
        public static ServiceInfo GetServiceInfo()
        {
            //Get the operating enterprise terminal
            ServiceInfo        terminal = null;
            TsortServiceClient client   = new TsortServiceClient();

            try {
                terminal = client.GetServiceInfo(int.Parse(Program.TerminalCode));
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> efe) { client.Abort(); throw new ApplicationException(efe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(terminal);
        }