public static LocalTerminals GetLocalTerminals() { LocalTerminals terminal = null; try { _Client = new MobileDevicesServiceClient(); terminal = _Client.GetLocalTerminals(); _Client.Close(); } catch (FaultException fe) { throw new ApplicationException("() service error.", fe); } catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("() timeout error.", te); } catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("() communication error.", ce); } return(terminal); }
public LocalTerminals GetLocalTerminals() { //Get a list of enterprise terminals LocalTerminals terminals = null; try { terminals = new LocalTerminals(); DataSet ds = fillDataset(USP_LOCAL_TERMINALS, TBL_LOCAL_TERMINALS, new object[] { }); if (ds != null) { for (int i = 0; i < ds.Tables[TBL_LOCAL_TERMINALS].Rows.Count; i++) { long id = long.Parse(ds.Tables[TBL_LOCAL_TERMINALS].Rows[i]["TerminalID"].ToString()); string name = ds.Tables[TBL_LOCAL_TERMINALS].Rows[i]["TerminalName"].ToString(); terminals.Add(new LocalTerminal(id, name)); } } } catch (Exception ex) { throw new FaultException <TerminalsFault>(new TerminalsFault(new ApplicationException("Unexpected error while reading local terminals.", ex))); } return(terminals); }