Пример #1
0
        public static void ProcessCards()
        {
            var ndl = new NaggerDataLinker();

            List <Card> cards = ndl.GetCardCollection();

            int currentColumn = 0;

            foreach (var card in cards)
            {
                currentColumn = card.ColumnID;
                card.ColumnID = (int)card.AssignColumn();

                if (card.ColumnID != currentColumn)
                {
                    ndl.UpdateCard(card);
                }
            }

            Console.WriteLine("Could Do: {0}", cards.Count(c => c.AssignColumn() == ColumnType.colCould));
            Console.WriteLine("Should Do: {0}", cards.Count(c => c.AssignColumn() == ColumnType.colShould));
            Console.WriteLine("Must Do: {0}", cards.Count(c => c.AssignColumn() == ColumnType.colMust));
            Console.WriteLine("Done: {0}", cards.Count(c => c.AssignColumn() == ColumnType.colDone));
            Console.WriteLine("Skipped: {0}", cards.Count(c => c.AssignColumn() == ColumnType.colSkip));
        }
Пример #2
0
        // GET: Nags
        public ActionResult Index()
        {
            var model = new List <CardViewModel>();

            NaggerDataLinker ndl   = new NaggerDataLinker();
            List <Card>      cards = ndl.GetCardCollection();

            var viewModel =
                from c in cards
                join m in db.Columns on c.ColumnID equals m.ID
                join l in db.Locations on c.LocationID equals l.ID
                join b in db.Boards on c.BoardID equals b.ID
                join f in db.Frequencies on c.FrequencyID equals f.DayCount
                select new CardViewModel {
                ColumnDescription    = m.Description,
                BoardDescription     = b.Description,
                LocationDescription  = l.Description,
                FrequencyDescription = f.Description,
                Mandated             = c.Mandated,
                BoardID     = c.BoardID,
                FrequencyID = c.FrequencyID,
                LocationID  = c.LocationID,
                Title       = c.Title,
                Description = c.Description
            };

            return(View(viewModel));
        }
Пример #3
0
        public void GetAllNags()
        {
            ArrayList objs = new ArrayList();

            try
            {
                var ndl = new NaggerDataLinker();

                List <Card> cards = ndl.GetCardCollection();

                foreach (var card in cards)
                {
                    objs.Add(new
                    {
                        id          = card.ID,
                        title       = card.Title,
                        columnID    = card.ColumnID,
                        description = card.Description,
                        board       = card.BoardID,
                        frequencyID = card.FrequencyID,
                        dueDate     = card.DueDate,
                        lastDone    = card.LastDone,
                        skipCount   = card.SkipCount
                    });
                }
            }
            catch (Exception ex)
            {
                if (log.IsDebugEnabled)
                {
                    log.DebugFormat("Error getting Nags: {0}", ex.Message);
                }
            }

            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            Context.Response.Write(JsonConvert.SerializeObject(objs));
        }