Exemplo n.º 1
0
        public void AddPackage(Package package)
        {
            SKS_PDS.DAL.SortPackage sortpackage = new SKS_PDS.DAL.SortPackage();

            SKS_PDS.Entities.Package importpackage = new SKS_PDS.Entities.Package(package.Id, " ", " ", " ", " ", sortpackage.GetClosestRegionId(package.Address.PostalCode, package.Address.City, package.Address.Street), package.Address.City, package.Address.Country, package.Address.PostalCode, package.Address.Street);

            DataControllLayer datacontrolllayer = new DataControllLayer();
            datacontrolllayer.AddPackage(importpackage);
        }
Exemplo n.º 2
0
        public Package[] GetPackagesForRegion(string regionKey)
        {
            DataControllLayer datacontrollayer = new DataControllLayer();

            SKS_PDS.Entities.Package[] packagearray = datacontrollayer.GetPackagesForRegion(regionKey);

            List<Package> packagelist = new List<Package>();

            foreach (SKS_PDS.Entities.Package package in packagearray)
            {
                Package tmppackage = new Package();
                tmppackage.Id = package.PackageID;
                tmppackage.Address.City = package.City;
                tmppackage.Address.Country = package.Country;
                tmppackage.Address.PostalCode = package.Postalcode;
                tmppackage.Address.Street = package.Street;

                packagelist.Add(tmppackage);
            }

            return packagelist.ToArray();
        }