예제 #1
0
        public InboundShipment GetInboundShipment(string freightID)
        {
            //Return the inbound shipment for the specified freightID
            InboundShipment shipment = null;

            try {
                DataSet ds = new DataService().FillDataset(SQL_CONNID, USP_SHIPMENT, TBL_FREIGHT, new object[] { freightID });
                if (ds != null & ds.Tables[TBL_FREIGHT].Rows.Count > 0)
                {
                    FreightDS freight = new FreightDS();
                    freight.Merge(ds, false, MissingSchemaAction.Ignore);
                    shipment = new InboundShipment(freight.InboundFreightTable[0]);
                }
            }
            catch (Exception ex) { throw new FaultException <FreightFault>(new FreightFault(new ApplicationException("Unexpected error while reading inbound shipment.", ex))); }
            return(shipment);
        }
예제 #2
0
        public InboundFreight GetInboundFreight(int terminalID, int sortedRange)
        {
            //Get a list of inbound shipments for the specified terminal
            InboundFreight shipments = new InboundFreight();

            try {
                DataSet ds = new DataService().FillDataset(SQL_CONNID, USP_FREIGHT, TBL_FREIGHT, new object[] { terminalID, DateTime.Today.AddDays(-sortedRange) });
                if (ds != null)
                {
                    FreightDS freight = new FreightDS();
                    freight.Merge(ds, true);
                    for (int i = 0; i < freight.InboundFreightTable.Rows.Count; i++)
                    {
                        shipments.Add(new InboundShipment(freight.InboundFreightTable[i]));
                    }
                }
            }
            catch (Exception ex) { throw new FaultException <FreightFault>(new FreightFault(new ApplicationException("Unexpected error while reading inbound freight.", ex))); }
            return(shipments);
        }
예제 #3
0
        public StationAssignments GetStationAssignments()
        {
            //Get a list of station-freight assignments for the local terminal
            StationAssignments assignments = new StationAssignments();

            try {
                DataSet ds = new DataService().FillDataset(SQL_CONNID, USP_ASSIGNMENTS, TBL_ASSIGNMENTS, new object[] {});
                if (ds != null)
                {
                    FreightDS assignmentsDS = new FreightDS();
                    assignmentsDS.Merge(ds, false, MissingSchemaAction.Ignore);
                    for (int i = 0; i < assignmentsDS.StationFreightAssignmentTable.Rows.Count; i++)
                    {
                        assignments.Add(new StationAssignment(assignmentsDS.StationFreightAssignmentTable[i]));
                    }
                }
            }
            catch (Exception ex) { throw new FaultException <FreightFault>(new FreightFault(new ApplicationException("Unexpected error while reading station assignments.", ex))); }
            return(assignments);
        }