Пример #1
0
        public List <KreiraniObrok> GetCreatedMealListByDate(string datum)
        {
            INamirnica           repo      = RepoFactory.GetNamirnicaRepo();
            List <KreiraniObrok> kolekcija = new List <KreiraniObrok>();

            var meals = FilterMealByDate(datum);

            foreach (var item in meals)
            {
                KreiraniObrok obrok = new KreiraniObrok();
                obrok.IDObrok        = item.IDObrok;
                obrok.DatumIzrade    = item.DatumIzrade;
                obrok.NazivObroka    = item.NazivObroka;
                obrok.ListaNamirnica = repo.GetIngredientForMeal(item.IDObrok);
                kolekcija.Add(obrok);
            }

            return(kolekcija);
        }
Пример #2
0
        public List <KreiraniObrok> GetMealsForUserById(int idKorisnik)
        {
            INamirnica repo = RepoFactory.GetNamirnicaRepo();

            ds = SqlHelper.ExecuteDataset(cs, "GetMealsForUser", idKorisnik);
            List <KreiraniObrok> kolekcija = new List <KreiraniObrok>();

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                KreiraniObrok o = new KreiraniObrok();
                o.IDObrok        = (int)row["IDObrok"];
                o.NazivObroka    = (string)row["NazivObroka"];
                o.DatumIzrade    = (DateTime)row["DatumIzrade"];
                o.ListaNamirnica = repo.GetIngredientForMeal(o.IDObrok); //????
                kolekcija.Add(o);
            }

            return(kolekcija);
        }