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); }
//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); }
//Interface static TsortGateway() { // _Zones = new FreightDataset(); _TLs = new FreightDataset(); TsortServiceClient client = new TsortServiceClient(); _state = true; _address = client.Endpoint.Address.Uri.AbsoluteUri; }
//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(); }
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); }
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); } }
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); }
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); }