Exemplo n.º 1
0
        public ActionResult Index()
        {
            DashboardViewModel dashboardVM = new DashboardViewModel();

            SprintService sprintService = new SprintService();

            dashboardVM.Sprint  = sprintService.RetornaUltimoSprint();
            dashboardVM.Eventos = db.Eventos.Where(c => c.SprintId == dashboardVM.Sprint.Id || c.Fixo == "S").ToList();


            int dias = dashboardVM.Sprint.DataFim.Subtract(dashboardVM.Sprint.DataInicio).Days;

            for (int i = 0; i < dias; i++)
            {
                dashboardVM.DiasSprint.Add(dashboardVM.Sprint.DataInicio.AddDays(i));
            }

            foreach (var dashboardVmEvento in dashboardVM.Eventos)
            {
                DateTime dataFinal   = dashboardVM.Sprint.DataFim;
                int      tmSpanTotal = dashboardVM.Sprint.DataFim.Subtract(dashboardVM.Sprint.DataInicio).Days;
                int      tmSpan      = tmSpanTotal - (dashboardVM.Sprint.DataFim.Subtract(dashboardVmEvento.DataEvento).Days);



                dashboardVmEvento.PorcentagemSprint = Convert.ToInt32(((double)tmSpan / (double)tmSpanTotal) * 100);
            }

            return(View(dashboardVM));
        }
Exemplo n.º 2
0
        // GET: Eventoes
        public ActionResult Index()
        {
            SprintService sprintService = new SprintService();
            Sprint        sprintAtual   = sprintService.RetornaUltimoSprint();

            return(View(db.Eventos.Where(c => c.SprintId == sprintAtual.Id || c.Fixo == "S").OrderBy(c => c.DataEvento).ToList()));
        }
        // GET: ScrumBoard
        public ActionResult Index()
        {
            ScrumBoardViewModel scrumBoardViewModel = new ScrumBoardViewModel();
            SprintService       sprintService       = new SprintService();
            Sprint sprintAtual = sprintService.RetornaUltimoSprint();
            List <SprintAuxiliar> sprintAuxiliars = db.SprintAuxiliar.AsNoTracking().Where(c => c.SprintId == sprintAtual.Id).ToList();

            scrumBoardViewModel.Sprint = sprintAtual;

            sprintAuxiliars.ForEach(historiaAux =>
            {
                scrumBoardViewModel.Historias.Add(db.Historias.SingleOrDefault(c => c.Id == historiaAux.HistoriaId));
            });

            scrumBoardViewModel.ColunasScrum = db.ScrumBoardColunas.AsNoTracking().OrderBy(c => c.Ordem).ToList();

            return(View(scrumBoardViewModel));
        }