Example #1
0
 public TeamManageModel(Cell item)
 {
     this.Id = item.CellID;
     this.CellName = item.CellName;
     this.Members = TeamMember.GetTeamMembers(item.CellID);
     this.Roles = RoleModel.GetRoles();
 }
Example #2
0
        private bool PostModel(CellModel model)
        {
            using (var ctx = new Entities())
            {
                Cell item;

                if (model.Id != 0)
                {
                    item = ctx.Cells.FirstOrDefault(i => i.CellID == model.Id);

                    if (item == null)
                    {
                        return false;
                    }
                }
                else
                {
                    item = new Cell();
                }

                item.CellName = model.CellName;
                item.Tag = Utils.Tagify(model.CellName);
                item.Description = model.Description;

                if (model.Id == 0)
                {
                    ctx.Cells.Add(item);
                }

                if (SaveChanges(ctx) != 0)
                {
                    return true;
                }
            }

            return false;
        }
Example #3
0
 public CellModel(Cell item)
 {
     this.Id = item.CellID;
     this.CellName = item.CellName;
     this.Description = item.Description;
 }
Example #4
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();
            }
        }
Example #5
0
 public TeamIndexModel(Cell item)
 {
     this.Id = item.CellID;
     this.CellName = item.CellName;
     this.Members = TeamMember.GetTeamMembers(item.CellID);
 }