protected override FeedContext <V2FeedPackage> CreateDataSource()
 {
     return(new FeedContext <V2FeedPackage>
     {
         Packages = PackageRepo.GetAll().Where(p => p.StatusForDatabase == submittedStatus).WithoutVersionSort().ToV2FeedPackageQuery(GetSiteRoot())
     });
 }
Ejemplo n.º 2
0
        public void LoadPackages(Repository repository)
        {
            using (LogAggregator la = LogAggregator.InUnity(
                       "Packages successfully loaded from {0}",
                       "Packages successfully loaded from {0}, but warning were raised",
                       "Error(s) occured while loading packages from {0}",
                       repository.ToString()
                       ))
            {
                Upset[] packages;
                try
                {
                    packages = repository.ListPackages();
                }
                catch (Exception e)
                {
                    Debug.LogException(e);
                    return;
                }

                PackageRepo pr;
                foreach (Upset package in packages)
                {
                    pr = new PackageRepo
                    {
                        Package    = package,
                        Repository = repository
                    };
                    Packages.Add(pr);
                }
            }
        }
Ejemplo n.º 3
0
        public IQueryable <V2FeedPackage> Search(string searchTerm, string targetFramework, bool includePrerelease)
        {
            var packages = PackageRepo.GetAll()
                           .Where(p => p.StatusForDatabase == PackageStatusType.Submitted.GetDescriptionOrValue());

            return(SearchCore(packages, searchTerm, targetFramework, includePrerelease).ToV2FeedPackageQuery(GetSiteRoot()));
        }
Ejemplo n.º 4
0
        private void SiparisFiyatHesapla()
        {
            if (cmbOrderName.SelectedIndex == -1)
            {
                return;
            }

            PackageRepo db      = new PackageRepo();
            OrderRepo   dbOrder = new OrderRepo();



            foreach (var item1 in dbOrder.GetAll())
            {
                decimal total = 0;

                if (cmbOrderName.SelectedItem.ToString() == item1.OrderName.ToString())
                {
                    foreach (var item in db.GetAll())
                    {
                        if (item.OrderId == (cmbOrderName.SelectedItem as Order).OrderId)
                        {
                            total += item.PackagePurchasingPrice;
                        }
                    }

                    lblOrderPriceText.Text = total.ToString();
                    break;
                }
            }
        }
Ejemplo n.º 5
0
 public void UpdatePackage(PackageRepo packageRepo)
 {
     using (TemporaryDirectory td = packageRepo.Repository.DownloadPackage(packageRepo.Package))
     {
         UpdatePackage(packageRepo.Package, td);
     }
 }
Ejemplo n.º 6
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            PackageRepo db = new PackageRepo();

            if (lstOrder.SelectedIndex == -1)
            {
                return;
            }
            var seciliPaketSil = lstOrder.SelectedItem as Package;

            foreach (var item in db.GetAll())
            {
                if (item.OrderId == seciliPaketSil.OrderId)
                {
                    db.Delete(seciliPaketSil);
                    break;
                }
            }

            lstOrder.Items.Clear();
            lstOrder.Items.AddRange(db.GetAll(x => x.OrderId == (cmbOrderName.SelectedItem as Order).OrderId).ToArray());

            FormHelper.FormuTemizle(this);
            cmbPackageProduct.SelectedIndex = -1;
            SiparisFiyatHesapla();
        }
Ejemplo n.º 7
0
        private void DependencyStateBlock(
            DependencyDefinition definition,
            PackageRepo bestMatch,
            PackageRepo latest,
            InstalledPackage installed
            )
        {
            EditorGUILayout.LabelField(definition.Name + ":", EditorStyles.boldLabel);
            EditorGUILayout.LabelField("Requirement: " + definition.Requirement.ToString());
            if (installed != null)
            {
                EditorGUILayout.LabelField("Installed version: " + installed.Version);

                if (VersionParser.GreaterThan(bestMatch.Package.PackageVersion, installed.Version))
                {
                    EditorGUILayout.HelpBox(
                        string.Format(
                            "Package is outdated. You can update it to {0} (from {1})",
                            bestMatch.Package.PackageVersion,
                            bestMatch.Repository.ToString()
                            ),
                        MessageType.Info
                        );
                    if (GUILayout.Button("Update to version " + bestMatch.Package.PackageVersion))
                    {
                        UpliftManager.Instance().UpdatePackage(bestMatch, updateLockfile: true);
                        Init();
                        Repaint();
                    }
                }
                else
                {
                    EditorGUILayout.HelpBox("Package is up to date!", MessageType.Info);
                }

                if (!definition.Requirement.IsMetBy(installed.Version))
                {
                    EditorGUILayout.HelpBox(
                        "The version of the package currently installed does not match the requirements of your project!",
                        installed.Version != bestMatch.Package.PackageVersion ? MessageType.Warning : MessageType.Error
                        );
                }
            }
            else
            {
                EditorGUILayout.LabelField("Not yet installed");
            }

            if (latest.Package.PackageVersion != bestMatch.Package.PackageVersion)
            {
                EditorGUILayout.HelpBox(
                    string.Format(
                        "Note: there is a more recent version of the package ({0} from {1}), but it doesn't match your requirement",
                        latest.Package.PackageVersion,
                        bestMatch.Repository.ToString()
                        ),
                    MessageType.Info
                    );
            }
        }
Ejemplo n.º 8
0
        private void FormControlleriDoldur()
        {
            PackageRepo db    = new PackageRepo();
            ProductRepo dbpro = new ProductRepo();

            var seciliPaket = lstOrder.SelectedItem as Package;

            foreach (var item in db.GetAll())
            {
                if (item.ProductId == seciliPaket.ProductId)
                {
                    cmbPackageProduct.SelectedItem = item.Product;
                    txtPackageBarcode.Text         = item.PackageBarcode;
                    txtPackageName.Text            = item.PackageName;
                    nmOrderQuantity.Value          = item.PackageProductQuantity;

                    foreach (var item1 in dbpro.GetAll())
                    {
                        if (item1.ProductPurchasingPrice == seciliPaket.PackagePurchasingPrice)
                        {
                            txtOrderPackagePrice.Text = (item1.ProductPurchasingPrice * item.PackageProductQuantity).ToString();
                        }
                    }
                }
            }
        }
Ejemplo n.º 9
0
        public IQueryable <V2FeedPackage> FindPackagesById(string id)
        {
            var packages = PackageRepo.GetAll()
                           .Include(p => p.PackageRegistration)
                           .Where(p => p.PackageRegistration.Id.Equals(id) && (p.StatusForDatabase != _rejectedStatus || p.StatusForDatabase == null));

            //if (searchService.ContainsAllVersions)
            //{
            //    return NugetGallery.Cache.Get(
            //        string.Format("V2Feed-FindPackagesById-{0}", id.to_lower()),
            //        DateTime.UtcNow.AddSeconds(DEFAULT_CACHE_TIME_SECONDS_V2FEED),
            //        () =>
            //        {
            //            var searchFilter = GetSearchFilter(searchService.ContainsAllVersions, HttpContext.Request.RawUrl, id, includePrerelease: true);
            //            // Find packages by Id specific items
            //            searchFilter.ExactIdOnly = true;
            //            searchFilter.TakeAllResults = true;
            //            searchFilter.SortProperty = SortProperty.Version;
            //            searchFilter.SortDirection = SortDirection.Descending;

            //            return SearchCore(packages, id, string.Empty, includePrerelease: true, searchFilter: searchFilter, useCache: true)
            //                .ToV2FeedPackageQuery(GetSiteRoot())
            //                .ToList();
            //        }).AsQueryable();
            //}

            return(NugetGallery.Cache.Get(
                       string.Format("V2Feed-FindPackagesById-{0}", id.to_lower()),
                       DateTime.UtcNow.AddSeconds(DEFAULT_CACHE_TIME_SECONDS_V2FEED * 3),
                       () => packages
                       .ToV2FeedPackageQuery(GetSiteRoot())
                       .ToList()
                       ).AsQueryable());
        }
Ejemplo n.º 10
0
        protected virtual IQueryable <Package> SearchCore(string searchTerm, string targetFramework, bool includePrerelease)
        {
            // Filter out unlisted packages when searching. We will return it when a generic "GetPackages" request comes and filter it on the client.
            var packages = PackageRepo.GetAll()
                           .Include(p => p.PackageRegistration)
                           .Include(x => x.Authors)
                           .Include(x => x.PackageRegistration.Owners)
                           .Where(p => p.Listed);

            if (String.IsNullOrEmpty(searchTerm))
            {
                return(packages);
            }

            var          request = new HttpRequestWrapper(HttpContext.Current.Request);
            SearchFilter searchFilter;

            // We can only use Lucene if the client queries for the latest versions (IsLatest \ IsLatestStable) versions of a package.
            if (TryReadSearchFilter(request, out searchFilter))
            {
                searchFilter.SearchTerm        = searchTerm;
                searchFilter.IncludePrerelease = includePrerelease;

                return(GetResultsFromSearchService(packages, searchFilter));
            }
            return(packages.Search(searchTerm));
        }
Ejemplo n.º 11
0
        public void RefreshPackagesTest()
        {
            Mock <Repository> repo_mock            = new Mock <Repository>();
            Mock <Upset>      package_dummy_old    = new Mock <Upset>();
            Mock <Upset>      package_dummy_recent = new Mock <Upset>();
            PackageRepo       old_pr = new PackageRepo
            {
                Package    = package_dummy_old.Object,
                Repository = repo_mock.Object
            };
            PackageRepo recent_pr = new PackageRepo
            {
                Package    = package_dummy_recent.Object,
                Repository = repo_mock.Object
            };

            repo_mock.Setup(repo => repo.ListPackages()).Returns(new Upset[] { package_dummy_recent.Object });

            (pl as PackageListTester).SetPackages(new List <PackageRepo> {
                old_pr
            });
            (pl as PackageListTester).SetRepositories(new Repository[] { repo_mock.Object });
            pl.RefreshPackages();
            List <PackageRepo> result = (pl as PackageListTester).GetPackages();

            CollectionAssert.DoesNotContain(result, old_pr);
            CollectionAssert.Contains(result, recent_pr);
        }
Ejemplo n.º 12
0
        private void txtBarcodePackage_KeyDown(object sender, KeyEventArgs e)
        {
            if (txtBarcodePackage.Text == null)
            {
                return;
            }
            if (e.KeyCode == Keys.Enter)
            {
                bool varMi = false;
                List <PackageViewModel> packages = new List <PackageViewModel>();
                try
                {
                    packages.AddRange(new PackageRepo().GetAll()
                                      .OrderBy(x => x.PackageType)
                                      .Select(x => new PackageViewModel()
                    {
                        Id          = x.Id,
                        PackageType = x.PackageType,
                        Barcode     = x.Barcode,
                        BuyPrice    = x.BuyPrice,
                        ProductId   = x.ProductId
                    }));
                    if (packages.Count == 0)
                    {
                        MessageBox.Show("Lütfen önce ürün barkodu girin");
                        return;
                    }

                    var sonuc = new PackageRepo().GetAll(x => x.Barcode == txtBarcodePackage.Text).FirstOrDefault();
                    foreach (var item in packages)
                    {
                        if (item.Barcode == txtBarcodePackage.Text)
                        {
                            txtBarcodeProduct.Text  = sonuc.Product.Barcode;
                            txtCategory.Text        = sonuc.Product.Category.CategoryName;
                            txtProduct.Text         = sonuc.Product.ProductName;
                            nuPackageQuantity.Value = sonuc.PackageType;
                            varMi = true;
                            break;
                        }
                    }

                    if (varMi == false)
                    {
                        MessageBox.Show("Lütfen Ürün barkodunu giriniz");

                        ch.FormClearHelper(this);
                    }
                }
                catch (DbEntityValidationException ex)
                {
                    new EntityHelper().FindError(ex);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Ejemplo n.º 13
0
 public IQueryable <V1FeedPackage> Search(string searchTerm, string targetFramework)
 {
     // Only allow listed stable releases to be returned when searching the v1 feed.
     return(PackageRepo.GetAll()
            .Where(p => !p.IsPrerelease && p.Listed)
            .Search(searchTerm)
            .ToV1FeedPackageQuery(Configuration.SiteRoot));
 }
Ejemplo n.º 14
0
 public IQueryable <V2FeedPackage> FindPackagesById(string id)
 {
     return
         (PackageRepo.GetAll()
          .Include(p => p.PackageRegistration)
          .Where(p => p.PackageRegistration.Id.Equals(id, StringComparison.OrdinalIgnoreCase) && p.StatusForDatabase == submittedStatus)
          .ToV2FeedPackageQuery(GetSiteRoot()));
 }
Ejemplo n.º 15
0
        public QuotationController()
        {
            _enqRepo = new EnquiryRepo();

            _pRepo = new PackageRepo();

            _qRepo = new QuotationRepo();
        }
Ejemplo n.º 16
0
 protected override FeedContext <V2FeedPackage> CreateDataSource()
 {
     return(new FeedContext <V2FeedPackage>
     {
         Packages = PackageRepo.GetAll()
                    .ToV2FeedPackageQuery(Configuration.SiteRoot)
     });
 }
Ejemplo n.º 17
0
        public UpdateLocalChocoTask(bool includePreReleases, PackageRepo repo, Action <Package> addPackageCallback)
        {
            this.repo = repo;
            this.addPackageCallback = addPackageCallback;

            Config.CommandName           = "list";
            Config.Prerelease            = includePreReleases;
            Config.ListCommand.LocalOnly = true;
        }
Ejemplo n.º 18
0
        public IQueryable <V2FeedPackage> Search(string searchTerm, string targetFramework, bool includePrerelease)
        {
            var packages = PackageRepo.GetAll()
                           .Include(p => p.PackageRegistration)
                           .Include(p => p.PackageRegistration.Owners)
                           .Where(p => p.Listed);

            return(SearchCore(packages, searchTerm, targetFramework, includePrerelease).ToV2FeedPackageQuery(GetSiteRoot()));
        }
Ejemplo n.º 19
0
 protected override FeedContext <V2FeedPackage> CreateDataSource()
 {
     return(new FeedContext <V2FeedPackage>
     {
         Packages = PackageRepo.GetAll()
                    .WithoutVersionSort()
                    .ToV2FeedPackageQuery(Configuration.GetSiteRoot(UseHttps()))
     });
 }
Ejemplo n.º 20
0
 protected override FeedContext <V1FeedPackage> CreateDataSource()
 {
     return(new FeedContext <V1FeedPackage>
     {
         Packages = PackageRepo.GetAll()
                    .Where(p => !p.IsPrerelease)
                    .ToV1FeedPackageQuery(Configuration.SiteRoot)
     });
 }
Ejemplo n.º 21
0
        private PackageRepo[] IdentifyInstallable(DependencyDefinition[] definitions)
        {
            PackageRepo[] result = new PackageRepo[definitions.Length];
            for (int i = 0; i < definitions.Length; i++)
            {
                result[i] = PackageList.Instance().FindPackageAndRepository(definitions[i]);
            }

            return(result);
        }
Ejemplo n.º 22
0
        public EnquiryController()
        {
            _pRepo = new PackageRepo();

            _hRepo = new HotelRepo();

            _enqRepo = new EnquiryRepo();

            _cRepo = new CityRepo();
        }
Ejemplo n.º 23
0
        public IQueryable <V1FeedPackage> Search(string searchTerm, string targetFramework)
        {
            var packages = PackageRepo.GetAll()
                           .Include(p => p.PackageRegistration)
                           .Include(p => p.PackageRegistration.Owners)
                           .Where(p => p.Listed && !p.IsPrerelease);

            // For v1 feed, only allow stable package versions.
            packages = SearchCore(packages, searchTerm, targetFramework, includePrerelease: false);
            return(packages.ToV1FeedPackageQuery(Configuration.GetSiteRoot(UseHttps())));
        }
Ejemplo n.º 24
0
        public LohanaPackageTariffController()
        {
            _lpRepo = new LohanaPackageTariffRepo();

            _hRepo = new HotelRepo();

            _htRepo = new HotelTariffRepo();

            _vtRepo = new VehicleTariffRepo();

            _pRepo = new PackageRepo();
        }
Ejemplo n.º 25
0
        private void btnOrderSave_Click(object sender, EventArgs e)
        {
            bool varMi = false;

            PackageRepo db      = new PackageRepo();
            OrderRepo   dbOrder = new OrderRepo();

            try
            {
                Package package = new Package();


                package.PackageName            = txtPackageName.Text;
                package.ProductId              = (cmbPackageProduct.SelectedItem as Product).ProductId;
                package.OrderId                = (cmbOrderName.SelectedItem as Order).OrderId;
                package.PackagePurchasingPrice = Convert.ToDecimal(txtOrderPackagePrice.Text);
                package.PackageProductQuantity = Convert.ToInt32(nmOrderQuantity.Value);
                package.PackageBarcode         = txtPackageBarcode.Text;


                foreach (var item in lstOrder.Items)
                {
                    if (package.PackageBarcode == (item as Package).PackageBarcode || package.PackageName == (item as Package).PackageName)
                    {
                        varMi = true;
                        break;
                    }
                }

                if (varMi == false)
                {
                    db.Insert(package);
                    MessageBox.Show("Sipariş sepetine yeni ürün eklenmiştir.");
                }
                else
                {
                    MessageBox.Show("Seçili olan siparişte bu ürün zaten mevcuttur.");
                }

                dbOrder.Update();

                PaketleriGetir();

                SiparisFiyatHesapla();
            }
            catch (Exception)
            {
                throw;
            }

            dbOrder.Update();
            db.Update();
        }
Ejemplo n.º 26
0
        public IQueryable <V2FeedPackage> Search(string searchTerm, string targetFramework, bool includePrerelease)
        {
            // Filter out unlisted packages when searching. We will return it when a generic "GetPackages" request comes and filter it on the client.
            var packages = PackageRepo.GetAll().Where(p => p.Listed);

            if (!includePrerelease)
            {
                packages = packages.Where(p => !p.IsPrerelease);
            }
            return(packages.Search(searchTerm)
                   .ToV2FeedPackageQuery(Configuration.SiteRoot));
        }
Ejemplo n.º 27
0
        public IQueryable <V1FeedPackage> Search(string searchTerm, string targetFramework)
        {
            // Only allow listed stable releases to be returned when searching the v1 feed.
            var packages = PackageRepo.GetAll().Where(p => !p.IsPrerelease && p.Listed);

            if (String.IsNullOrEmpty(searchTerm))
            {
                return(packages.ToV1FeedPackageQuery(Configuration.SiteRoot));
            }
            return(SearchService.Search(packages, searchTerm)
                   .ToV1FeedPackageQuery(Configuration.SiteRoot));
        }
Ejemplo n.º 28
0
        public IQueryable <V2FeedPackage> FindPackagesById(string id)
        {
            var rejectedStatus = PackageStatusType.Rejected.GetDescriptionOrValue();

            return(NugetGallery.Cache.Get(
                       string.Format("V2Feed-FindPackagesById-{0}", id.to_lower()),
                       DateTime.UtcNow.AddSeconds(DEFAULT_CACHE_TIME_SECONDS_V2FEED),
                       () => PackageRepo.GetAll().Include(p => p.PackageRegistration)
                       .Where(p => p.PackageRegistration.Id.Equals(id, StringComparison.OrdinalIgnoreCase) && (p.StatusForDatabase != rejectedStatus || p.StatusForDatabase == null))
                       .ToV2FeedPackageQuery(GetSiteRoot())
                       .ToList().AsQueryable()));
        }
        public IQueryable <V2FeedPackage> Search(string searchTerm, string targetFramework, bool includePrerelease)
        {
            var packages        = PackageRepo.GetAll().Where(p => p.StatusForDatabase == PackageStatusType.Submitted.GetDescriptionOrValue());
            var packageVersions = SearchCore(packages, searchTerm, targetFramework, includePrerelease, SearchFilter.Empty()).ToV2FeedPackageQuery(GetSiteRoot()).ToList();

            if (!includePrerelease)
            {
                return(packageVersions.Where(p => !p.IsPrerelease).AsQueryable());
            }

            return(packageVersions.AsQueryable());
        }
Ejemplo n.º 30
0
        private void PaketleriGetirMalKabul()
        {
            if (cmbGoodsAcceptanceOrders.SelectedIndex == -1)
            {
                return;
            }

            ProductRepo dbpro = new ProductRepo();
            OrderRepo   dbord = new OrderRepo();
            PackageRepo dbpck = new PackageRepo();


            var orders = new List <OrderViewModel>();

            try
            {
                foreach (var item in dbord.GetAll())
                {
                    if (item.OrderId == (cmbGoodsAcceptanceOrders.SelectedItem as Order).OrderId)
                    {
                        foreach (var item1 in dbpck.GetAll())
                        {
                            if (item1.OrderId == item.OrderId)
                            {
                                foreach (var item2 in dbpro.GetAll())
                                {
                                    if (item2.ProductId == item1.ProductId)
                                    {
                                        orders.Add(new OrderViewModel()
                                        {
                                            PackageName            = item1.PackageName,
                                            PackageBarcode         = item1.PackageBarcode,
                                            PackageId              = item1.PackageId,
                                            ProductId              = item2.ProductId,
                                            ProductStock           = item2.ProductStock,
                                            PackageProductQuantity = item1.PackageProductQuantity
                                        });
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            cmbOrderProduct.Items.Clear();
            cmbOrderProduct.Items.AddRange(orders.ToArray());
        }