示例#1
0
        public List <Tuple <string, string> > GetQues(string ques)
        {
            var responseData = new List <Tuple <string, string> >();

            var names = new List <QASMain>();

            for (int i = 0; i < 5; i++)
            {
                var q = new QASMain();
                q.Qid   = i;
                q.Qdesc = "QDESC - " + i.ToString();
                names.Add(q);
            }


            if (names.Count() > 1)
            {
                for (int i = 0; i < names.Count(); i++)
                {
                    responseData.Add(new Tuple <string, string>(names[i].Qid.ToString(), names[i].Qdesc));
                }
            }

            return(responseData);
        }
示例#2
0
        public List <QASMain> GetQues2(string ques)
        {
            var names  = new List <QASMain>();
            var result = new UserAgentBot.Repository.QuesAnsRepo().GetList(ques);

            for (int i = 0; i < result.Count(); i++)
            {
                var q = new QASMain();
                q.Qid   = result[i].QuesAnsId;
                q.Qdesc = result[i].QuestionDesc;

                q.FileName = result[i].FileName;
                q.FilePath = result[i].FilePath;
                names.Add(q);
            }
            //if (!string.IsNullOrEmpty(ques))
            //    return names.Where(q => q.Qdesc.Contains(ques)).ToList();
            //else
            return(names);
        }
示例#3
0
        public QASMain GetById(string quesID)
        {
            var result       = new UserAgentBot.Repository.QuesAnsRepo().Get(quesID);
            var responseData = new QASMain();

            if (result != null)
            {
                responseData.Qid      = result.QuesAnsId;
                responseData.Qdesc    = result.QuestionDesc;
                responseData.Ansdesc  = result.AnswerDesc;
                responseData.FilePath = result.FilePath;
                responseData.FileName = result.FileName;
            }
            else
            {
                responseData.Qid   = 1;
                responseData.Qdesc = "QDESC - 1";
            }
            return(responseData);
        }