Esempio n. 1
0
        public static DbItemOpremaSaParametrima[] kolekcijaOpremeZaIdKolekcije(int idKolekcijeOpreme, kolekcija_opreme[] svaOpremaIzKolekcijeOpreme, SmartSoftwareBazaEntities entities)
        {
            int [] nizIdjeva =
                (from kolekcijaOpreme in svaOpremaIzKolekcijeOpreme
                 where kolekcijaOpreme.id_opreme == idKolekcijeOpreme
                 select kolekcijaOpreme.id_deo
                ).ToArray();

            List <DbItemOpremaSaParametrima> opremeZaKolekciju = new List <DbItemOpremaSaParametrima>();

            foreach (var item in nizIdjeva)
            {
                opremeZaKolekciju.Add(OpOpremaSelectFilteri.vratiOpremuZaIdOpreme(item, entities));
                int index = opremeZaKolekciju.Count - 1;
                opremeZaKolekciju[index].ListaParametara = VratiParametreZaOpremu(opremeZaKolekciju[index].id_oprema, entities);
            }

            return(opremeZaKolekciju.ToArray());
        }
        public override OperationObject execute(SmartSoftwareBazaEntities entities)
        {
            DbItemNarudzbine[] niz =
                (from narudzbina in entities.narudzbines
                 select new DbItemNarudzbine()
            {
                datum_narudzbine = narudzbina.datum_narudzbine,
                kolicina = narudzbina.kolicina,
                id_prodavca = narudzbina.id_prodavca,
                id_oprema = narudzbina.id_oprema,
                id_narudzbine = narudzbina.id_narudzbine
            }).ToArray();

            foreach (var item in niz)
            {
                item.prodavac       = OpIstorijaKupovineBase.VratiProdavcaZaIdProdavca(item.id_prodavca, entities);
                item.narucenaOprema = OpOpremaSelectFilteri.vratiOpremuZaIdOpreme(item.id_oprema, entities);
            }
            OperationObject opObj = new OperationObject();

            opObj.Niz     = niz;
            opObj.Success = true;
            return(opObj);
        }