Esempio n. 1
0
 public void TrackPackageStatusChange(PackageStatus fromStatus, PackageStatus toStatus)
 {
     _telemetryClient.TrackMetric(
         PackageStatusChange,
         1,
         new Dictionary <string, string>
     {
         { FromStatus, fromStatus.ToString() },
         { ToStatus, toStatus.ToString() },
     });
 }
 public void TrackPackageStatusChange(string packageId, string normalizedVersion, Guid validationTrackingId, PackageStatus fromStatus, PackageStatus toStatus)
 {
     _telemetryClient.TrackMetric(
         PackageStatusChange,
         1,
         new Dictionary <string, string>
     {
         { PackageId, packageId },
         { NormalizedVersion, normalizedVersion },
         { ValidationTrackingId, validationTrackingId.ToString() },
         { FromStatus, fromStatus.ToString() },
         { ToStatus, toStatus.ToString() },
     });
 }
        public IEnumerable <PackageWithoutCourierViewModel> GetPackages(int courierId, PackageStatus status)
        {
            if (courierId == 0)
            {
                return(_dbContext.Packages.Where(x => x.CourierId == null && x.Status == status.ToString()).Select(x => new PackageWithoutCourierViewModel()
                {
                    Address = x.Address,
                    CustomerEmail = x.CustomerEmail,
                    Id = x.Id,
                    Status = x.Status,
                    Check = false
                }).AsNoTracking().ToList());
            }

            return(_dbContext.Packages.Where(x => x.CourierId == courierId && x.Status == status.ToString()).Select(x => new PackageWithoutCourierViewModel()
            {
                Address = x.Address,
                CustomerEmail = x.CustomerEmail,
                Id = x.Id,
                Status = x.Status,
                Check = false
            }).AsNoTracking().ToList());
        }