コード例 #1
0
        public List <PackageTransit> GetActiveTransitsByPackage(Package xPackage)
        {
            List <PackageTransit> filteredList = new List <PackageTransit>();

            foreach (PackageTransit t in MockDataAccess.GetAllPackageTransits())
            {
                if (t.Package == xPackage && t.DateReceived == null && t.DateCancelled == null)
                {
                    filteredList.Add(t);
                }
            }
            return(filteredList);
        }
コード例 #2
0
        public PackageTransit GetOpenTransit(Package Package)
        {
            foreach (PackageTransit t in MockDataAccess.GetAllPackageTransits())
            {
                if (t.Package == Package &&
                    t.DateReceived == null &&
                    t.DateCancelled == null)
                {
                    return(t);
                }
            }

            return(null);
        }
コード例 #3
0
        public PackageTransit GetTransit(Package Package, DistributionCentre receiver) // dc
        {
            foreach (PackageTransit t in MockDataAccess.GetAllPackageTransits())
            {
                if (t.Package == Package &&
                    (receiver == null || t.ReceiverCentre == receiver) &&
                    t.DateReceived == null &&
                    t.DateCancelled == null)
                {
                    return(t);
                }
            }

            return(null);
        }
コード例 #4
0
        public void TestMockDb_ShowAllTables()
        {
            List <DistributionCentre> distList = MockDataAccess.GetAllDistibutionCentres();

            Debug.WriteLine("DISTRIBUTION CENTRES : ");
            foreach (DistributionCentre centre in distList)
            {
                Debug.WriteLine(centre);
            }

            List <Employee> employeeList = MockDataAccess.GetAllEmployees();

            Debug.WriteLine("\n\n EMPLOYEES : ");
            foreach (Employee emp in employeeList)
            {
                Debug.WriteLine(emp);
            }

            List <StandardPackageType> typeList = MockDataAccess.GetAllPackageTypes();

            Debug.WriteLine("\n\n STANDARD PACKAGE TYPES : ");
            foreach (StandardPackageType t in typeList)
            {
                Debug.WriteLine(t);
            }

            List <Package> packageList = MockDataAccess.GetAllPackages();

            Debug.WriteLine("\n\n PACKAGES : ");
            foreach (Package p in packageList)
            {
                Debug.WriteLine(p);
            }

            List <PackageTransit> transitList = MockDataAccess.GetAllPackageTransits();

            Debug.WriteLine("\n\n PACKAGE TRANSITS : ");
            foreach (PackageTransit t in transitList)
            {
                Debug.WriteLine(t);
            }

            Assert.IsNotNull(employeeList);
        }