Пример #1
0
        private async Task <ItemDetails> GetItemDetails(BasketItem item)
        {
            var result = await _itemsService.GetItems(new List <int> {
                item.ItemId
            });

            return(result.Item.Count == 0
                ? ItemDetails.Empty
                : result.Item.First());
        }
Пример #2
0
        public async Task <IActionResult> Get(ItemSearchParameter search)
        {
            _logger.LogDebug($"Get items - ApiVersion: {RequestedApiVersion}");
            var items = await _itemsService.GetItems(search);

            var itemDtos = _mapper.Map <PagedListDto <ItemDto> >(items);

            itemDtos.BuildNavigationLinks(Request.GetDisplayUrl());
            return(Ok(itemDtos));
        }
Пример #3
0
        public void Run()
        {
            _consoleWriter.WriteWelcomeMessage();
            IList <SuperItem> Items = _itemsService.GetItems();

            for (var i = 0; i < 31; i++)
            {
                _consoleWriter.WriteItemsToConsole(Items, i);
                _gildedRose.UpdateQuality(Items);
            }
        }
        public ActionResult Create(long?id)
        {
            if (id == null)
            {
                // ViewBag.IdModel = new SelectList(db.GEN_Model.Where(e => e.IdSociete == CurrentSocieteId), "Id", "Model");
                ViewBag.IdModel = new SelectList(modelsService.GetModels(), "Id", "Model");
                return(View());
            }
            else
            {
                // GEN_Items gEN_Items = db.GEN_Items.Find(id);
                var gEN_Items = itemsServise.GetItems(id);
                ItemsFormViewModel gEN_Devises = Mapper.Map <ItemsPivot, ItemsFormViewModel>(gEN_Items);

                if (gEN_Items == null)
                {
                    return(RedirectToAction("Index"));
                }
                // ViewBag.IdModel = new SelectList(db.GEN_Model.Where(e => e.IdSociete == CurrentSocieteId), "Id", "Model", gEN_Items.IdModel);
                ViewBag.IdModel = new SelectList(modelsService.GetModels(), "Id", "Model", gEN_Devises.IdModel);

                return(View(gEN_Devises));
            }
        }
Пример #5
0
        public async Task <IActionResult> GetItems()
        {
            List <Items> items = await Task.Run(() => items = itemsService.GetItems());

            List <ItemsViewModel> itemsViewModels = new List <ItemsViewModel>();

            foreach (Items item in items)
            {
                itemsViewModels.Add(new ItemsViewModel
                {
                    ItemId      = item.itemid,
                    PartNum     = item.partnum,
                    Price       = item.price,
                    ProdId      = item.prodid,
                    ProductName = item.productname,
                    Quantity    = item.quantity
                });
            }

            return(Ok(itemsViewModels));
        }
Пример #6
0
        public PaginatedResult <ItemViewModel> Get(PaginatedConfiguration pagination)
        {
            var items = _itemsService.GetItems(pagination);

            return(items);
        }
        private List <GCItem> GetItems(int projectId)
        {
            ItemsEntity items = ItemsService.GetItems(projectId.ToString());

            return(items.Data);
        }
Пример #8
0
        public async Task <IActionResult> GetItem(int id)
        {
            var Items = await itemsService.GetItems(id);

            return(Ok(Items));
        }
Пример #9
0
        public ActionResult Create(long?id, string type)
        {
            TiersPivot CurrentObj;

            ViewBag.type = type;

            if (id == null)
            {
                CurrentObj = tiersService.GetTiers();


                if (CurrentObj != null)
                {
                    tiersService.DeleteTiers(CurrentObj);
                }

                ViewBag.Collectif       = null;
                ViewBag.IdDeviseDefault = new SelectList(devisesService.GetDevisesByIDDossierAndActif(), "DevisesId", "DevisesCode");
                ViewBag.IdDossier       = new SelectList(dossiersService.GetDossiersByActif(true), "DossierId", "CodeDossier");
                ViewBag.IdEcheancement  = new SelectList(typePaiementService.GetTypePaiemenByIDDossierAndActif(), "TypePaiementId ", "Libelle");

                ViewBag.TypeTiers = new SelectList(itemsService.GetItemsByModelAndActif(type), "Id", "Libelle");

                ViewBag.FormeJuridique       = new SelectList(itemsService.GetItemsByModel("FormeJuridique"), "Id", "Libelle");
                ViewBag.Pays                 = new SelectList(itemsService.GetItemsByModel("Pays"), "Id", "Libelle");
                ViewBag.Ville                = new SelectList(itemsService.GetItemsByModel("Ville"), "Id", "Libelle");
                ViewBag.IdentifiantFiscale   = new SelectList(itemsService.GetItemsByModel("IdentifiantFiscale"), "Id", "Libelle");
                ViewBag.IdCategorieFiscale   = new SelectList(itemsService.GetItemsByModel("CategorieFiscale"), "Id", "Libelle");
                ViewBag.activite             = new SelectList(itemsService.GetItemsByModel("activite"), "Id", "Libelle");
                ViewBag.IdGroupeStatistiques = new SelectList(itemsService.GetItemsByModel("GroupeStatistiques"), "Id", "Libelle");

                ViewBag.IdGroupeRemise               = new SelectList(itemsService.GetItemsByModel("GroupeRemise"), "Id", "Libelle");
                ViewBag.IdCompteCollectifClient      = new SelectList(compte_GService.GetCPT_CompteGsByActifandIDDossierandValeur("Clients").Select(x => new { Id = x.Id, Value = x.Code + " " + x.Libelle }), "Id", "Value");
                ViewBag.IdCompteCollectifFournisseur = new SelectList(compte_GService.GetCPT_CompteGsByActifandIDDossierandValeur("Fournisseurs").Select(x => new { Id = x.Id, Value = x.Code + " " + x.Libelle }), "Id", "Value");

                return(View());
            }
            else
            {
                CurrentObj      = tiersService.GetTier(id);
                ViewBag.Message = TempData["errorMessage"] + "";
                if (CurrentObj == null)
                {
                    TempData["Message"] = "Le tier que vous cherchez n'existe pas.";
                    return(RedirectToAction("Index", "Tiers"));
                }

                // ViewBag.IdDeviseDefault = new SelectList(db.GEN_Devises.Where(e => e.IdDossier == CurrentPreference.IdDossier && e.Actif), "Id", "Code", CurrentObj.IdDeviseDefault);
                // ViewBag.IdDossier = new SelectList(db.GEN_Dossiers.Where(e => e.IdSociete == CurrentSocieteId && e.Actif), "Id", "CodeDossier", CurrentObj.IdDossier);
                // ViewBag.IdEcheancement = new SelectList(db.GEN_TypePaiement.Where(e => e.IdDossier == CurrentPreference.IdDossier && e.Actif), "Id", "Libelle", CurrentObj.IdEcheancement);
                ViewBag.IdDeviseDefault = new SelectList(devisesService.GetDevisesByIDDossierAndActif(), "DevisesId", "DevisesCode");
                ViewBag.IdDossier       = new SelectList(dossiersService.GetDossiersByActif(true), "DossierId", "CodeDossier");

                ViewBag.IdEcheancement = new SelectList(typePaiementService.GetTypePaiemenByIDDossierAndActif(), "TypePaiementId ", "Libelle");


                if (type == null)
                {
                    var items = itemsService.GetItems(CurrentObj.TypeTiers);

                    ViewBag.TypeTiers = new SelectList(itemsService.GetItemsByModelAndActif(type), "Id", "Libelle");

                    //ViewBag.TypeTiers = new SelectList(db.GEN_Items.Where(e => e.GEN_Model.Model == "NatureTiers" && e.Valeur.Contains(CurrentObj.GEN_Items_TypeTiers.Valeur) && e.GEN_Model.IdSociete == CurrentSocieteId) items, "Id", "Libelle", CurrentObj.TypeTiers);
                }
                else
                {
                    ViewBag.TypeTiers = new SelectList(itemsService.GetItemsByModelAndActif(type), "Id", "Libelle");

                    //ViewBag.TypeTiers = new SelectList(db.GEN_Items.Where(e => e.GEN_Model.Model == "NatureTiers" && e.Valeur.Contains(type) && e.GEN_Model.IdSociete == CurrentSocieteId), "Id", "Libelle", CurrentObj.TypeTiers);
                }

                ViewBag.FormeJuridique       = new SelectList(itemsService.GetItemsByModel("FormeJuridique"), "Id", "Libelle");
                ViewBag.Pays                 = new SelectList(itemsService.GetItemsByModel("Pays"), "Id", "Libelle");
                ViewBag.Ville                = new SelectList(itemsService.GetItemsByModel("Ville"), "Id", "Libelle");
                ViewBag.IdentifiantFiscale   = new SelectList(itemsService.GetItemsByModel("IdentifiantFiscale"), "Id", "Libelle");
                ViewBag.IdCategorieFiscale   = new SelectList(itemsService.GetItemsByModel("CategorieFiscale"), "Id", "Libelle");
                ViewBag.activite             = new SelectList(itemsService.GetItemsByModel("activite"), "Id", "Libelle");
                ViewBag.IdGroupeStatistiques = new SelectList(itemsService.GetItemsByModel("GroupeStatistiques"), "Id", "Libelle");
                ViewBag.IdGroupeRemise       = new SelectList(itemsService.GetItemsByModel("GroupeRemise"), "Id", "Libelle");

                ViewBag.IdCompteCollectifClient      = new SelectList(compte_GService.GetCPT_CompteGsByActifandIDDossierandValeur("Clients").Select(x => new { Id = x.Id, Value = x.Code + " " + x.Libelle }), "Id", "Value");
                ViewBag.IdCompteCollectifFournisseur = new SelectList(compte_GService.GetCPT_CompteGsByActifandIDDossierandValeur("Fournisseurs").Select(x => new { Id = x.Id, Value = x.Code + " " + x.Libelle }), "Id", "Value");

                var tierForm = Mapper.Map <GEN_Tiers_Form_ViewModel>(CurrentObj);
                var typeTier = itemsService.GetItems(CurrentObj.TypeTiers).Valeur;
                tierForm.TypeTierCode = typeTier;
                //tierForm.typeTierCode = CurrentObj.GEN_Items_TypeTiers.Valeur;
                return(View(tierForm));
            }
        }
 public ICollection <ItemsModel> GetItems()
 {
     return(_itemRepository.GetItems());
 }
Пример #11
0
 public IActionResult GetItems()
 {
     return(Ok(itemsService.GetItems()));
 }