public ZoneDataset GetZones() { //Get a list of zones ZoneDataset zones = null; try { zones = new ZoneDataset(); DataSet ds = FillDataset(USP_ZONES, TBL_ZONES, new object[] { }); if (ds.Tables[TBL_ZONES].Rows.Count != 0) { zones.Merge(ds); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected exception creating zone list.", ex); } return(zones); }
public ZoneDataset GetZones(int terminalID) { //Get a list of open TLs ZoneDataset zones = new ZoneDataset(); ZoneClosingServiceClient client = new ZoneClosingServiceClient(); try { DataSet ds = client.GetTLs(terminalID); if (ds != null) { zones.Merge(ds); } 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(zones); }
public ZoneDataset GetZone(int terminalID, string zoneCode) { //Get a single open TL ZoneDataset zone = new ZoneDataset(); ZoneClosingServiceClient client = new ZoneClosingServiceClient(); try { DataSet ds = client.GetTLs(terminalID); if (ds != null) { ZoneDataset _zones = new ZoneDataset(); _zones.Merge(ds); zone.Merge(_zones.ZoneTable.Select("Zone='" + zoneCode + "'")); } 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(zone); }