public static RSReportsDataset GetDepots(string terminalCode) { // RSReportsDataset depots = new RSReportsDataset(); RSReportsServiceClient client = new RSReportsServiceClient(); try { DataSet ds = client.GetDepots(); if (ds != null) { depots.Merge(ds); for (int i = 0; i < depots.DepotTable.Rows.Count; i++) { string orderClass = depots.DepotTable[i].RS_OrderClass; if (!(terminalCode.Length == 0 || orderClass == terminalCode)) { depots.DepotTable[i].Delete(); } } depots.DepotTable.AcceptChanges(); } client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <RoadshowFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(depots); }