Exemple #1
0
 public ActionResult userSearch(string q)
 {
     SearchQuestionModel sqm = new SearchQuestionModel();
     sqm.user = model.selectByUName(q);
     ViewBag.searchContent = q;
     return View(sqm);
 }
Exemple #2
0
        public ActionResult questionSearch(string q)
        {
            SearchQuestionModel sqm = new SearchQuestionModel();

            sqm.question = model.selectByKeywords(q);
            sqm.answer   = new List <List <Answer> >();
            sqm.user     = new List <List <User> >();
            for (int i = 0; i < sqm.question.Count(); i++)
            {
                List <Answer> a = new List <Answer>();
                sqm.answer.Add(a);
                List <User> u = new List <User>();
                sqm.user.Add(u);

                for (int j = 0; j < sqm.question[i].Count(); j++)
                {
                    if (model.getHotAnswerByQuestionID(sqm.question[i][j].QID).AID == 0)
                    {
                        sqm.answer[i].Add(model.getHotAnswerByQuestionID(sqm.question[i][j].QID));

                        sqm.user[i].Add(new User());
                    }
                    else
                    {
                        sqm.answer[i].Add(model.getHotAnswerByQuestionID(sqm.question[i][j].QID));
                        sqm.user[i].Add(model.getUserByAnswerID(sqm.answer[i][j].AID));
                    }
                }
            }
            ViewBag.searchContent = q;

            return(View(sqm));
        }
Exemple #3
0
        public ActionResult questionSearch(string q)
        {
            SearchQuestionModel sqm = new SearchQuestionModel();
            sqm.question = model.selectByKeywords(q);
            sqm.answer = new List<List<Answer>>();
            sqm.user = new List<List<User>>();
            for (int i = 0; i < sqm.question.Count(); i++)
            {
                List<Answer> a= new List<Answer>();
                sqm.answer.Add(a);
                List<User> u = new List<User>();
                sqm.user.Add(u);

                for (int j = 0; j < sqm.question[i].Count(); j++)
                {

                    if (model.getHotAnswerByQuestionID(sqm.question[i][j].QID).AID==0)
                    {
                        sqm.answer[i].Add(model.getHotAnswerByQuestionID(sqm.question[i][j].QID));

                        sqm.user[i].Add(new User());
                    }
                    else
                    {
                        sqm.answer[i].Add(model.getHotAnswerByQuestionID(sqm.question[i][j].QID));
                        sqm.user[i].Add(model.getUserByAnswerID(sqm.answer[i][j].AID));
                    }
                }
            }
            ViewBag.searchContent = q;

            return View(sqm);
        }
Exemple #4
0
        public ActionResult userSearch(string q)
        {
            SearchQuestionModel sqm = new SearchQuestionModel();

            sqm.user = model.selectByUName(q);
            ViewBag.searchContent = q;
            return(View(sqm));
        }