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); }
public static bool UpdateScanAudit(RSReportsDataset.ScanAuditTableRow audit) { // bool updated = false; RSReportsServiceClient client = new RSReportsServiceClient(); try { ScanAudit sa = new ScanAudit(); sa.RecordID = audit.RecordID; sa.Arrive = !audit.IsArriveNull() ? audit.Arrive : ""; sa.Bell = !audit.IsBellNull() ? audit.Bell : ""; sa.DeliveryStart = !audit.IsDelStartNull() ? audit.DelStart : ""; sa.DeliveryEnd = !audit.IsDelEndNull() ? audit.DelEnd : ""; sa.Departure = !audit.IsDepartNull() ? audit.Depart : ""; sa.TimeEntryBy = !audit.IsTimeEntryByNull() ? audit.TimeEntryBy : ""; sa.OnTimeIssue = !audit.IsOnTimeIssueNull() ? audit.OnTimeIssue : ""; sa.AdditionalComments = !audit.IsAdditCommentsNull() ? audit.AdditComments : ""; updated = client.UpdateScanAudit(sa); 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(updated); }
public static bool UpdatePickup(RSReportsDataset.PickupTableRow pickup) { // bool updated = false; RSReportsServiceClient client = new RSReportsServiceClient(); try { Pickup p = new Pickup(); p.RecordID = !pickup.IsRecordIDNull() ? pickup.RecordID : 0; p.Driver = !pickup.IsDriverNull() ? pickup.Driver : ""; p.RouteName = !pickup.IsRt_NameNull() ? pickup.Rt_Name : ""; p.CustomerID = !pickup.IsCustomer_IDNull() ? pickup.Customer_ID : ""; p.CustomerName = !pickup.IsCustomerNameNull() ? pickup.CustomerName : ""; p.CustomerType = !pickup.IsCustTypeNull() ? pickup.CustType : ""; p.CustomerAddress = !pickup.IsAddressNull() ? pickup.Address : ""; p.CustomerCity = !pickup.IsCityNull() ? pickup.City : ""; p.CustomerState = !pickup.IsStateNull() ? pickup.State : ""; p.CustomerZip = !pickup.IsZipNull() ? pickup.Zip : ""; p.ActualOrderSize = !pickup.IsActOrdSizeNull() ? pickup.ActOrdSize : 0; p.ActualOrderWeight = !pickup.IsActOrdLbsNull() ? pickup.ActOrdLbs : 0; p.UnscheduledPickup = !pickup.IsUnsched_PUNull() ? pickup.Unsched_PU : ""; p.Comments = !pickup.IsCommentsNull() ? pickup.Comments : ""; p.ActualCommodity = !pickup.IsActCmdtyNull() ? pickup.ActCmdty : ""; updated = client.UpdatePickup(p); 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(updated); }
public static void WriteLogEntry(TraceMessage m) { //Get the operating enterprise terminal RSReportsServiceClient client = new RSReportsServiceClient(); try { client.WriteLogEntry(m); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <ConfigurationFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } }
public static bool LoadPickups(DateTime pickupDate, string routeClass) { //Load pickup data bool loaded = false; RSReportsServiceClient client = new RSReportsServiceClient(); try { loaded = client.LoadPickups(pickupDate, routeClass); 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(loaded); }
public static ServiceInfo GetServiceInfo() { //Get the operating enterprise terminal ServiceInfo terminal = null; RSReportsServiceClient client = new RSReportsServiceClient(); try { terminal = client.GetServiceInfo(); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <ConfigurationFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(terminal); }
public static UserConfiguration GetUserConfiguration(string application, string[] usernames) { //Get the operating enterprise terminal UserConfiguration config = null; RSReportsServiceClient client = new RSReportsServiceClient(); try { config = client.GetUserConfiguration(application, usernames); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <ConfigurationFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(config); }
public static RSReportsDataset GetUpdateUsers(string routeClass) { // RSReportsDataset users = new RSReportsDataset(); RSReportsServiceClient client = new RSReportsServiceClient(); try { DataSet ds = client.GetUpdateUsers(routeClass); if (ds != null) { users.Merge(ds); } 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(users); }
public static RSReportsDataset GetOrderTypes() { // RSReportsDataset types = new RSReportsDataset(); RSReportsServiceClient client = new RSReportsServiceClient(); try { DataSet ds = client.GetOrderTypes(); if (ds != null) { types.Merge(ds); } 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(types); }
public static RSReportsDataset GetScanAudits(DateTime routeDate, string routeClass) { // RSReportsDataset scans = new RSReportsDataset(); RSReportsServiceClient client = new RSReportsServiceClient(); try { DataSet ds = client.ReadScanAudits(routeDate, routeClass); if (ds != null) { scans.Merge(ds); } 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(scans); }