Exemplo n.º 1
0
        public static TsortDataset GetStationAssignments(InboundShipment shipment, string workStationID)
        {
            //Get a list of station-freight assignments for the specified terminal and workstation
            TsortDataset assignments = new TsortDataset();

            try {
                TsortDataset _assignments        = GetStationAssignments();
                TsortDataset selectedAssignments = new TsortDataset();
                if (workStationID.Trim().Length == 0)
                {
                    selectedAssignments.Merge(_assignments.StationFreightAssignmentTable.Select("FreightID = '" + shipment.FreightID + "'"));
                }
                else
                {
                    selectedAssignments.Merge(_assignments.StationFreightAssignmentTable.Select("FreightID = '" + shipment.FreightID + "' AND WorkStationID = '" + workStationID + "'"));
                }
                for (int i = 0; i < selectedAssignments.StationFreightAssignmentTable.Rows.Count; i++)
                {
                    assignments.StationFreightAssignmentTable.ImportRow(selectedAssignments.StationFreightAssignmentTable[i]);
                }
            }
            catch (ApplicationException aex) { throw aex; }
            catch (Exception ex) { throw new ApplicationException(ex.Message); }
            return(assignments);
        }
Exemplo n.º 2
0
        public static bool HasAssignments(string freightID)
        {
            //Determine if the specified fright has assignments
            TsortDataset assignments = new TsortDataset();

            assignments.Merge(StationAssignments.StationFreightAssignmentTable.Select("FreightID = '" + freightID + "'"));
            return(assignments.StationFreightAssignmentTable.Count > 0);
        }
Exemplo n.º 3
0
        //Interface
        static TsortGateway()
        {
            //
            _InboundFreight    = new TsortDataset();
            _Assignments       = new TsortDataset();
            _AssignmentHistory = new TsortDataset();

            TsortServiceClient client = new TsortServiceClient();

            _state             = true;
            _address           = client.Endpoint.Address.Uri.AbsoluteUri;
            _AssignmentHistory = new TsortDataset();
        }
Exemplo n.º 4
0
        public static TsortDataset GetAssignableSortStations(InboundShipment shipment, int sortTypeID)
        {
            //
            TsortDataset sortStations         = new TsortDataset();
            FreightAssignServiceClient client = new FreightAssignServiceClient();

            try {
                DataSet ds = client.GetAssignableSortStations(shipment.TerminalID, shipment.FreightID, sortTypeID);
                if (ds != null)
                {
                    sortStations.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <TsortFault> 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(sortStations);
        }
Exemplo n.º 5
0
        public static TsortDataset GetStationAssignments()
        {
            //Get a list of station-freight assignments for the specified terminal
            TsortDataset assignments          = new TsortDataset();
            FreightAssignServiceClient client = new FreightAssignServiceClient();

            try {
                DataSet ds = client.GetStationAssignments(int.Parse(Program.TerminalCode));
                if (ds != null)
                {
                    assignments.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <TsortFault> 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(assignments);
        }
Exemplo n.º 6
0
        public static TsortDataset GetTerminals()
        {
            //
            TsortDataset terminals            = new TsortDataset();
            FreightAssignServiceClient client = new FreightAssignServiceClient();

            try {
                DataSet ds = client.GetTerminals();
                if (ds != null)
                {
                    terminals.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <TsortFault> 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(terminals);
        }