Esempio n. 1
0
        public ActionResult Board(string id, string s = "", string e = "")
        {
            ChelloClient client = TrelloClientFactory.Get();
            Board board = client.Boards.Single(id);
            ViewBag.BoardName = board.Name;
            ViewBag.BoardId = id;

            DateTime startDate = DateTime.MinValue;
            DateTime endDate = DateTime.MaxValue;

            DateTime.TryParseExact(s, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out startDate);

            if (!DateTime.TryParseExact(e, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out endDate))
            {
                endDate = DateTime.MaxValue;
            }

            ActivityRepository repository = new ActivityRepository(id);
            CumulativeFlowModel cards = new CumulativeFlowModel(repository, startDate, endDate);
            CumulativeFlowModel points = null;

            if (repository.Lists.SelectMany(l => l.Cards).Any(c => c.Points.HasValue))
            {
                points = new CumulativeFlowModel(repository, startDate, endDate, (cs) => { return cs.Where(c => c.Points.HasValue).Sum(c => c.Points.Value); }, "Points");
            }

            return View(new DiagramsModel(cards, points));
        }
Esempio n. 2
0
 public DiagramsModel(CumulativeFlowModel cards, CumulativeFlowModel points = null)
 {
     Cards = cards;
     Points = points;
 }
Esempio n. 3
0
 public DiagramsModel(CumulativeFlowModel cards, CumulativeFlowModel points = null)
 {
     Cards  = cards;
     Points = points;
 }