Esempio n. 1
0
        public ActionResult topics()
        {
            TopicSquare topics = new TopicSquare();

            topics.myUser = db.Users.Find(getCookie("id"));
            topics.topic  = db.Topics.ToList();
            topics.focus  = new List <bool>();
            for (int i = 0; i < topics.topic.Count(); i++)
            {
                int TID  = topics.topic[i].TID;
                int TUID = topics.myUser.UID;
                IEnumerable <FollowTopic> IsFocus = db.FollowTopics.Where(a => a.FollowingTID == TID).Where(b => b.FTUserID == TUID);
                if (IsFocus.Count() == 0)
                {
                    topics.focus.Add(false);
                }
                else
                {
                    topics.focus.Add(true);
                }
            }
            return(View(topics));
        }
Esempio n. 2
0
 public ActionResult topics()
 {
     TopicSquare topics = new TopicSquare();
     topics.myUser = db.Users.Find(getCookie("id"));
     topics.topic = db.Topics.ToList();
     topics.focus = new List<bool>();
     for (int i = 0; i < topics.topic.Count(); i++)
     {
         int TID = topics.topic[i].TID;
         int TUID = topics.myUser.UID;
         IEnumerable<FollowTopic> IsFocus = db.FollowTopics.Where(a => a.FollowingTID == TID).Where(b => b.FTUserID == TUID);
         if (IsFocus.Count() == 0)
         {
             topics.focus.Add(false);
         }
         else
         {
             topics.focus.Add(true);
         }
     }
     return View(topics);
 }