public ActionResult CadastrarBurnDown([Bind(Prefix = "item2")] BurnDown burnDown)
        {
            //var teste = HttpContext.Request.Params.Get(1);

            int idProjeto = Convert.ToInt32(Request.QueryString["idProjeto"]);

            int idSprint = Convert.ToInt32(Request.QueryString["idSprint"]);


            //var teste2 = RouteData.Values["idSprint"] + Request.Url.Query;

            var SprintBD = db.Sprints.Where(s => s.Id.Equals(idSprint)).FirstOrDefault();

            if (ModelState.IsValid)
            {
                SprintBD.BurnDown.Add(burnDown);

                try
                {
                    db.SaveChanges();
                }
                catch (Exception)
                {
                    throw;
                }

                return(RedirectToAction("ProjetoSprint", "Projetos", new { idProjeto, idSprint }));
            }
            return(View(SprintBD));
        }
Exemple #2
0
 private static HtmlBuilder DetailsHeader(
     this HtmlBuilder hb,
     IContext context,
     BurnDown burnDown,
     IEnumerable <int> updators,
     string ownerLabelText,
     Column column)
 {
     return(hb.Tr(css: "ui-widget-header", action: () =>
     {
         hb
         .Th(action: () => hb
             .Text(text: Displays.Date(context: context)))
         .Th(action: () => hb
             .Text(text: Displays.PlannedValue(context: context)))
         .Th(action: () => hb
             .Text(text: Displays.EarnedValue(context: context)))
         .Th(action: () => hb
             .Text(text: Displays.Difference(context: context)))
         .Th(action: () => hb
             .Text(text: ownerLabelText + " " + Displays.Total(context: context)));
         updators.ForEach(updatorId => hb
                          .Th(action: () => hb
                              .Text(text: SiteInfo.User(
                                        context: context,
                                        userId: updatorId).Name +
                                    " ({0})".Params(column.Display(
                                                        context: context,
                                                        value: burnDown
                                                        .Where(p => p.Updator == updatorId)
                                                        .Select(p => p.EarnedValueAdditions)
                                                        .Sum()) + column.Unit))));
     }));
 }
Exemple #3
0
 private static HtmlBuilder Details(
     this HtmlBuilder hb,
     IContext context,
     SiteSettings ss,
     BurnDown burnDown,
     string ownerLabelText,
     Column column)
 {
     if (burnDown.Select(o => o.EarnedValueAdditions).Sum() > 0)
     {
         var updators = burnDown
                        .Where(o => o.EarnedValueAdditions > 0)
                        .Select(o => o.Updator)
                        .OrderByDescending(o => burnDown
                                           .Where(p => p.Updator == o)
                                           .Select(p => p.EarnedValueAdditions)
                                           .Sum())
                        .Distinct()
                        .ToList();
         hb.Table(id: "BurnDownDetails", css: "grid not-link", action: () => hb
                  .THead(action: () => hb.DetailsHeader(
                             context: context,
                             burnDown: burnDown,
                             updators: updators,
                             ownerLabelText: ownerLabelText,
                             column: column))
                  .DetailsBody(
                      context: context,
                      ss: ss,
                      burnDown: burnDown,
                      updators: updators,
                      column: column));
     }
     return(hb);
 }
Exemple #4
0
 private static HtmlBuilder Body(this HtmlBuilder hb, IContext context, BurnDown burnDown)
 {
     return(hb.Div(action: () => hb
                   .Svg(id: "BurnDown")
                   .Hidden(
                       controlId: "BurnDownJson",
                       value: burnDown.Json(context: context))));
 }
        public ActionResult DeleteConfirmed(int id)
        {
            BurnDown burndown = db.BurnDowns.Find(id);

            db.BurnDowns.Remove(burndown);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,dia_sprint,qtd_reazalidas")] BurnDown burndown)
 {
     if (ModelState.IsValid)
     {
         db.Entry(burndown).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(burndown));
 }
        public ActionResult Create([Bind(Include = "id,dia_sprint,qtd_reazalidas")] BurnDown burndown)
        {
            if (ModelState.IsValid)
            {
                db.BurnDowns.Add(burndown);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(burndown));
        }
Exemple #8
0
 private static HtmlBuilder DetailsRow(
     this HtmlBuilder hb,
     IContext context,
     BurnDown burnDown,
     IEnumerable <int> updators,
     DateTime currentTime,
     Column column)
 {
     return(hb.Tr(
                attributes: new HtmlAttributes()
                .Class("grid-row")
                .Add("data-date", currentTime.ToShortDateString())
                .DataAction("BurnDownRecordDetails")
                .DataMethod("post"),
                action: () =>
     {
         var targets = burnDown.Targets(currentTime);
         var total = targets.Select(o => o.WorkValue).Sum();
         var planned = targets.Select(o => o.PlannedValue(currentTime)).Sum();
         var earned = total - targets.Select(o => o.EarnedValue).Sum();
         var difference = planned - earned;
         hb
         .Td(action: () => hb
             .Text(text: "{0} - {1}".Params(
                       currentTime.AddDays(-1).ToString(
                           Displays.Get(context: context, id: "YmdaFormat"),
                           context.CultureInfo()),
                       currentTime.ToString(
                           Displays.Get(context: context, id: "YmdaFormat"),
                           context.CultureInfo()))))
         .Td(action: () => hb
             .Text(text: column.Display(
                       context: context,
                       value: planned) + column.Unit))
         .Td(action: () => hb
             .Text(text: column.Display(
                       context: context,
                       value: earned) + column.Unit))
         .Td(value: difference, unit: column.Unit, css: "difference")
         .Td(value: burnDown
             .Where(o => o.UpdatedTime == currentTime)
             .Select(o => o.EarnedValueAdditions)
             .Sum(),
             unit: column.Unit);
         updators.ForEach(updator => hb
                          .Td(
                              value: burnDown
                              .Where(o => o.UpdatedTime == currentTime)
                              .Where(o => o.Updator == updator)
                              .Select(o => o.EarnedValueAdditions)
                              .Sum(),
                              unit: column.Unit));
     }));
 }
        // GET: /BurnDowns/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BurnDown burndown = db.BurnDowns.Find(id);

            if (burndown == null)
            {
                return(HttpNotFound());
            }
            return(View(burndown));
        }
Exemple #10
0
        private static HtmlBuilder DetailsBody(
            this HtmlBuilder hb,
            IContext context,
            SiteSettings ss,
            BurnDown burnDown,
            IEnumerable <int> updators,
            Column column)
        {
            var colspan        = updators.Count() + 1;
            var minTime        = burnDown.MinTime;
            var updatedMaxTime = burnDown.LatestUpdatedTime;
            var count          = Times.DateDiff(Times.Types.Days, minTime, updatedMaxTime);
            var first          = true;

            return(hb.TBody(action: () =>
            {
                for (var d = count; d >= 0; d--)
                {
                    var currentTime = minTime.AddDays(d);
                    if (burnDown.Any(o =>
                                     o.UpdatedTime == currentTime &&
                                     o.EarnedValueAdditions != 0))
                    {
                        hb.DetailsRow(
                            context: context,
                            burnDown: burnDown,
                            updators: updators,
                            currentTime: currentTime,
                            column: column);
                        if (first)
                        {
                            hb.BurnDownRecordDetails(
                                context: context,
                                elements: burnDown.Where(o => o.UpdatedTime == currentTime),
                                progressRateColumn: ss.GetColumn(
                                    context: context, columnName: "ProgressRate"),
                                statusColumn: ss.GetColumn(
                                    context: context, columnName: "Status"),
                                colspan: updators.Count() + 5,
                                unit: column.Unit);
                            first = false;
                        }
                    }
                }
            }));
        }
Exemple #11
0
        public static HtmlBuilder BurnDown(
            this HtmlBuilder hb,
            SiteSettings ss,
            IEnumerable <DataRow> dataRows,
            string ownerLabelText,
            Column column)
        {
            var burnDown = new BurnDown(ss, dataRows);

            return(hb
                   .Body(burnDown: burnDown)
                   .Details(
                       burnDown: burnDown,
                       ss: ss,
                       ownerLabelText: ownerLabelText,
                       column: column));
        }
        public ActionResult AtualizarBurnDown([Bind(Prefix = "item2")] BurnDown burnDown)
        {
            //var teste = HttpContext.Request.Params.Get(1);

            int idProjeto = Convert.ToInt32(Request.QueryString["idProjeto"]);

            int idSprint = Convert.ToInt32(Request.QueryString["idSprint"]);

            var BurndownBD = db.BurnDowns.Where(k => k.FK_Id_Sprint.Id == idSprint && k.dia_sprint.Equals(burnDown.dia_sprint)).FirstOrDefault();

            BurndownBD.qtd_reazalidas = burnDown.qtd_reazalidas;

            if (ModelState.IsValid)
            {
                db.Entry(BurndownBD).State = EntityState.Modified;
                db.SaveChanges();

                return(RedirectToAction("ProjetoSprint", "Projetos", new { idProjeto, idSprint }));
            }
            return(View(BurndownBD));
        }
        public ActionResult Create(BurnDown.Models.developer developer)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var db = new BurnDown.Models.DB();
                    db.developers.AddObject(developer);
                        db.SaveChanges();
                    // TODO: Add insert logic here

                    return RedirectToAction("Index");
                }
                catch
                {
                    return View(developer);
                }
            }
            else
            {
                return View(developer);
            }
        }
 partial void Insertdevloper(BurnDown.Models.devloper instance);
Exemple #15
0
        public string generateColor(BurnDown.Models.IChartable itemToColor)
        {
            string colorString;
            double totalHoursEstimated = (double)itemToColor.originalEstimatedHours;
            double hoursWorked = (double)itemToColor.hoursSpentOnItem;
              //  System.Nullable<int> taskDevAvailabilityPerDay = itemToColor.d;

            double percentageWorkCompleted = itemToColor.percentCompleted;
            percentageWorkCompleted = percentageWorkCompleted / 100;
            double percentageOfTimeSpent = hoursWorked / totalHoursEstimated;
            double redValue;
            double greenValue;

            double hoursRemaining = totalHoursEstimated - hoursWorked;

            //compare projected date to (current date + 80% of the time remaining to due date)
            //of it is less keep the color green
            // (daysSpent/estimation = percentage in terms of time) compare to workCompletedPercentage
            //

            string ontimeMin1 = "'rgb(0,28,229)'";
            string ontimeMin2 = "'rgb(0,219,198)'";
            string ontime = "'rgb(13,210,0)'";
            string ontimePlus1 = "'rgb(200,192,0)'";
            string ontimePlus2 = "'rgb(191,0,1)'";

            double status = (percentageOfTimeSpent / percentageWorkCompleted);

            if (status > 0.50)
            {
                colorString = ontimeMin2;
                if (status > 0.90)
                {
                    colorString = ontime;
                    if (status > 1.10)
                    {
                        colorString = ontimePlus1;
                        if (status > 1.50)
                        {
                            colorString = ontimePlus2;
                        }
                    }
                }
            }
            else
                colorString = ontimeMin1;

            return colorString;
        }
 partial void Updateproject(BurnDown.Models.project instance);
 partial void Insertproject(BurnDown.Models.project instance);
 partial void Updatetask(BurnDown.Models.task instance);
 partial void Deletetask(BurnDown.Models.task instance);
 partial void Inserttask(BurnDown.Models.task instance);
 partial void Deletedevloper(BurnDown.Models.devloper instance);
 partial void Updatedevloper(BurnDown.Models.devloper instance);
        public ActionResult Edit(int id, BurnDown.Models.developer developer)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var db = new BurnDown.Models.DB();
                    var developers = db.developers;
                    var dev = developers
                        .Where(w => w.developerId == developer.developerId)
                        .SingleOrDefault();
                    dev.firstName = developer.firstName;
                    dev.lastName = developer.lastName;
                    dev.email = developer.email;
                    dev.phone = developer.phone;
                    db.SaveChanges();
                    // TODO: Add insert logic here

                    return RedirectToAction("Index");
                }
                catch
                {
                    return View(developer);
                }
            }
            else
            {
                return View(developer);
            }
        }
 partial void Deleteproject(BurnDown.Models.project instance);