Example #1
0
 public Package GetPackageWidthBarCode(string BarCode)                           //   (P. 05-04-2015)
 {
     foreach (Package p in MockDataAccess.GetAllPackages())
     {
         if (p.BarCode == BarCode)
         {
             return(p);
         }
     }
     return(null);
 }
Example #2
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);
        }
Example #3
0
        public List <StockTaking> GetStocktaking(int CentreId)
        {
            List <StockTaking> sList = new List <StockTaking>();
            List <Package>     pList = MockDataAccess.GetAllPackages();

            foreach (Package p in pList)
            {
                if (p.CurrentLocation != null && p.CurrentLocation.CentreId == CentreId)
                {
                    StockTaking sP = new StockTaking();
                    sP.PackageTypeId          = p.PackageType.PackageTypeId;
                    sP.PackageTypeDescription = p.PackageType.Description;
                    sP.CostPerPackage         = p.PackageType.Value;
                    sP.BarCode        = p.BarCode;
                    sP.PackageId      = p.PackageId;
                    sP.ExpirationDate = p.ExpirationDate;
                    sList.Add(sP);
                }
            }
            return(sList);
        }
Example #4
0
        public Package Get(int?packageId, string barcode)
        {
            List <Package> packages = MockDataAccess.GetAllPackages();

            for (int i = 0; i < packages.Count; i++)
            {
                if (packages[i].BarCode == barcode)
                {
                    return(packages[i]);
                }
            }

            Package package = new Package
            {
                PackageId       = packageId ?? 1,
                PackageType     = MockDataAccess.GetPackageType(2),
                BarCode         = string.IsNullOrEmpty(barcode) ? "000012015070100001" : barcode,
                ExpirationDate  = new DateTime(2015, 7, 1),
                CurrentLocation = MockDataAccess.GetDistributionCentre(4),
                CurrentStatus   = PackageStatus.InStock
            };

            return(package);
        }