public PickupLogDataset ViewPickupLog(string clientNumber) { //View the pickup log PickupLogDataset requests = new PickupLogDataset(); DispatchClientServiceClient client = new DispatchClientServiceClient(); try { DataSet ds = client.ViewPickupLog(clientNumber); if (ds != null) { requests.Merge(ds); } client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); } return(requests); }
public PickupLogDataset ViewPickupLog(string schedule) { //View the pickup log PickupLogDataset requests = new PickupLogDataset(); DispatchServiceClient client = new DispatchServiceClient(); try { DateTime start = DateTime.Today; DateTime end = DateTime.Today; switch (schedule) { case "Today": break; case "Advanced": start = DateTime.Today.AddDays(1); end = DateTime.Today.AddDays(30); break; case "Archive": start = DateTime.Today.AddDays(-30); end = DateTime.Today.AddDays(-1); break; default: start = DateTime.Today.AddDays(-30); end = DateTime.Today.AddDays(30); break; } DataSet ds = client.ViewPickupLog(start, end); if (ds != null) { requests.Merge(ds); } client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); } return(requests); }