Example #1
0
        //
        // GET: /Projects/Details/5
        public ActionResult Details(int id)
        {
            var db = new BurnDown.Models.DB();
            var tasks = db.tasks;

            var project =
                from t in tasks
                where t.project_projectId == id
                select t;

            var pr =
                (from t in db.projects
                where t.projectId == id
                select t).Single();
            ViewData["projectName"] = pr.projectName;
            ViewData["projectId"] = pr.projectId;
            ViewData["devId"] = pr.leadDeveloper;
            foreach (var task in project)
            {
                var dev =
                    from t in tasks
                    where t.developer_developerId == task.developer_developerId && t.priority > task.priority
                    select new { t.originalEstimatedHours, t.hoursSpentOnTask };

                int hoursWithHigherPriority = 0;
                foreach (var times in dev)
                {
                    hoursWithHigherPriority = hoursWithHigherPriority + (times.originalEstimatedHours - times.hoursSpentOnTask);
                }

                task.hoursForTasksWithHigherPriority = hoursWithHigherPriority;

            }

            Models.projectChart pc = new Models.projectChart(project.ToArray());

            ViewData["projectChart"] = pc.createTasksChart("chartCanvas",150, 400);

            return View(project);
        }
Example #2
0
        //
        // GET: /Developers/Details/5
        public ActionResult Details(int id)
        {
            var db = new BurnDown.Models.DB();
            var developers = db.developers;
            var dev = from devs in developers where devs.developerId == id select devs;

               var tasks = db.tasks;

            var detasks =
                from t in tasks
                where t.developer_developerId == id
                select t;

            foreach (var task in detasks)
            {
                var thp =
                    from t in tasks
                    where t.developer_developerId == task.developer_developerId && t.priority > task.priority
                    select new { t.originalEstimatedHours, t.hoursSpentOnTask };

                int hoursWithHigherPriority = 0;
                foreach (var times in thp)
                {
                    hoursWithHigherPriority = hoursWithHigherPriority + (times.originalEstimatedHours - times.hoursSpentOnTask);
                }

                task.hoursForTasksWithHigherPriority = hoursWithHigherPriority;

            }

            Models.projectChart pc = new Models.projectChart(detasks.ToArray());

            ViewData["projectChart"] = pc.createTasksChart("chartCanvas", 150, 400);

               // return View(detasks);

            return View(dev.FirstOrDefault());
        }