Ejemplo n.º 1
0
        public HomeModel(Cell item)
        {
            this.CellName = item.CellName;
            this.Tag = item.Tag;
            this.Description = item.Description;
            this.Lists = new HomeListModel[]
            {
                new HomeListModel("Histórias", "Stories"),
                new HomeListModel("Requisitos", "Requirements"),
                new HomeListModel("Revisão", "Revision"),
            };

            using (var ctx = new Entities())
            {
                List<HomeListItemModel> items = null;

                items = new List<HomeListItemModel>();
                var a = ctx.GetLatestRequirements(item.CellID, null, 1).ToList();
                a.ForEach(i => items.Add(new HomeListItemModel(i.Tag, i.Title, i.Text)));
                this.Lists[0].Items = items.ToArray();

                items = new List<HomeListItemModel>();
                var b = ctx.GetLatestRequirements(item.CellID, null, 2).ToList();
                b.ForEach(i => items.Add(new HomeListItemModel(i.Tag, i.Title, i.Text)));
                this.Lists[1].Items = items.ToArray();

                items = new List<HomeListItemModel>();
                var c = ctx.GetLatestRequirements(item.CellID, null, 3).ToList();
                c.ForEach(i => items.Add(new HomeListItemModel(i.Tag, i.Title, i.Text)));
                this.Lists[2].Items = items.ToArray();
            }
        }