Beispiel #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);
        }
Beispiel #2
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);
        }
Beispiel #3
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); }
        }
Beispiel #4
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);
        }
Beispiel #5
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);
        }
Beispiel #6
0
        public static Workstation GetStation(string machinName)
        {
            //Get a view of TLs for the specified terminal
            Workstation workstation = null;

            try {
                workstation = _Client.GetStation(machinName);
            }
            catch (TimeoutException te) { _Client.Abort(); }
            catch (System.ServiceModel.CommunicationException ce) { _Client.Abort(); }
            return(workstation);
        }