public static TemplateDS GetTemplates() { //Get a collection of all ship schedules templates for all terminals TemplateDS templates = null; try { //Clear and update ship schedules templates = new TemplateDS(); DataSet ds = fillDataset(USP_TEMPLATES, TBL_TEMPLATES, null); if (ds.Tables[TBL_TEMPLATES].Rows.Count > 0) { templates.Merge(ds, true, MissingSchemaAction.Ignore); } } catch (Exception ex) { throw new ApplicationException("Failed to refresh templates list.", ex); } return(templates); }
public static TemplateDS GetTemplates() { //Get templates list TemplateDS templates = null; try { templates = new TemplateDS(); _Client = new ShipScheduleServiceClient(); DataSet ds = _Client.GetTemplates(); templates.Merge(ds); _Client.Close(); } catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException(te.Message, te.InnerException); } catch (FaultException <ShipScheduleFault> ssf) { throw new ApplicationException(ssf.Reason.ToString(), ssf.InnerException); } catch (FaultException fe) { throw new ApplicationException(fe.Message, fe.InnerException); } catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException(ce.Message, ce.InnerException); } return(templates); }