public ActionResult LiveChat(int?id)
        {
            DebateDisplayViewModel DDVM = FindDebateDisplayViewModel(id);

            ViewBag.Title = DDVM.Debate.Subject;

            return(View(DDVM));
        }
        public void DebateTest()
        {
            DebateController controller = new DebateController(debateRepository);

            DebateDisplayViewModel result = controller.FindDebateDisplayViewModel(1) as DebateDisplayViewModel;

            Assert.AreEqual(1, result.Debate.CreatorIdId);
        }
        public DebateDisplayViewModel FindDebateDisplayViewModel(int?id)
        {
            DebateDisplayViewModel DDVM = new DebateDisplayViewModel();

            DDVM.Debate = db.Debate.Find(id);
            UserInformation creator = db.UserInformation.Find(DDVM.Debate.CreatorIdId);

            DDVM.CreatorInformation = creator;

            UserInformation challenger = db.UserInformation.Find(DDVM.Debate.ChallengerIdId);

            DDVM.ChallengerInformation = challenger;

            Category category = db.Categories.Find(DDVM.Debate.CategoryIdId);

            DDVM.Category = category;

            return(DDVM);
        }
        public ActionResult Display(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            DebateDisplayViewModel DDVM = new DebateDisplayViewModel();

            DDVM.Debate = db.Debate.Find(id);

            /*
             * DDVM.CreatorInformation = db.UserInformation.ToList();
             * DDVM.ChallengerInformation = db.UserInformation.ToList();
             * DDVM.Category = db.Categories.ToList();
             */
            UserInformation creator = db.UserInformation.Find(DDVM.Debate.CreatorIdId);

            DDVM.CreatorInformation = creator;

            UserInformation challenger = db.UserInformation.Find(DDVM.Debate.ChallengerIdId);

            DDVM.ChallengerInformation = challenger;

            Category category = db.Categories.Find(DDVM.Debate.CategoryIdId);

            DDVM.Category = category;


            /*
             * if (DDVM.Debate == null || DDVM.Category == null || DDVM.CreatorInformation == null || DDVM.ChallengerInformation == null)
             * {
             *  return HttpNotFound();
             * }*/
            return(View(DDVM));
        }
 public ActionResult ShowEndScreen(DebateDisplayViewModel ddvm)
 {
     return(View());
 }