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); }
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); }
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); }
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); }