Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        //Interface
        static TerminalsGateway()
        {
            //
            RSReportsServiceClient client = new RSReportsServiceClient();

            _state   = true;
            _address = client.Endpoint.Address.Uri.AbsoluteUri;
        }
Beispiel #5
0
        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); }
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        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);
        }
Beispiel #8
0
        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);
        }
Beispiel #9
0
        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);
        }
Beispiel #10
0
        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);
        }
Beispiel #11
0
        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);
        }