public void RegisterPackage(Package pkg) { PackageStatus pkgStatus = new PackageStatus(); PackageDAO pkgDao = new PackageDAO(); PackageStatusDAO pkgStatusDao = new PackageStatusDAO(); pkgStatus.Status = "InStock"; pkgStatus.CentreSource = this.DistributionCentre; pkgStatus.CentreDestination = null; pkgDao.insertPackage(pkg); pkgStatusDao.insertPackageStatus(pkgStatus); }
public static void RegisterArrival(int packageId, int centreId, string staffId) { PackageStatus p = new PackageStatus(); p.PackageID = packageId; p.DestinationCentreID = centreId; p.StaffID = staffId; p.Status = (int)StatusEnum.InStock; using (var context = new Entities()) { context.PackageStatus.Add(p); context.SaveChanges(); } }
public PackageStatus GetPackageStatus(string barCode) { PackageStatus packageStatus = new PackageStatus(); return packageStatus; }
public static PackageStatus GetPackageStatusEager(PackageStatus status) { using (var context = new Entities()) { var query = from p in context.PackageStatus.Include("SourceCentre").Include("AspNetUser").Include("DestCentre").Include("Status1").Include("Package") where p.PackageStatusID == status.PackageStatusID select p; return query.First(); } }