Esempio n. 1
0
        public IActionResult GetDisLikersByQuestionAnswerId(long TutorQuestionAnswerId = 0)
        {
            QAResponse <List <TQuestionAnswerDisliker> > response = new QAResponse <List <TQuestionAnswerDisliker> >();

            response = TutorQuestionDB.GetDisLikersByQuestionAnswerId(TutorQuestionAnswerId, GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));
            return(Json(response));
        }
Esempio n. 2
0
        public IActionResult GetTutorQuestionAnswers(long UID = 0, long TQuestionId = 0)
        {
            QAResponse <List <TQuestionAnswer> > response = new QAResponse <List <TQuestionAnswer> >();

            response = TutorQuestionDB.GetAllTutorQuestionAnswers(UID, TQuestionId, GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));
            return(Json(response));
        }
Esempio n. 3
0
        public IActionResult GetCommentsByQuestionId(long TQuestionId = 0)
        {
            QAResponse <List <TQuestionComment> > response = new QAResponse <List <TQuestionComment> >();

            response = TutorQuestionDB.GetCommentsByQuestionId(TQuestionId, GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));
            return(Json(response));
        }
Esempio n. 4
0
        public IActionResult GetAllTags()
        {
            QAResponse <IList <string> > response = new QAResponse <IList <string> >();

            response.Content = TutorQuestionDB.GetAllTagsUnique(GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));
            return(Json(response));
        }
Esempio n. 5
0
        public IActionResult Vote(long TQuestionAnswerId, long UID, int ObjEntityId, int UpDownVote)
        {
            int x = TutorQuestionDB.Vote(TQuestionAnswerId, UID, ObjEntityId, UpDownVote, GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));

            if (x == 1)
            {
                Notify(UpDownVote == 1 ? "Like" : "Dislike");
            }
            return(Json(x));
        }
Esempio n. 6
0
        public int CloseQuestion(long TQuestionId, long tutorID)
        {
            int x = TutorQuestionDB.CloseQuestion(TQuestionId, tutorID, GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));

            if (x == 1)
            {
                Notify("Closed", "" + TQuestionId);
            }
            return(x);
        }
Esempio n. 7
0
        public IActionResult SubmitTutorQuestionAnswerComment(long TQuestionAnswerId, long UID, long ObjEntityId, string Description)
        {
            TQuestionAnswerComment newTutorQuestionAnswerComment = new TQuestionAnswerComment();

            newTutorQuestionAnswerComment = TutorQuestionDB.AddTutorQuestionAnswerComment(TQuestionAnswerId, UID, ObjEntityId, Description, GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));
            if (newTutorQuestionAnswerComment != null)
            {
                Notify("CommentedAnswer", "" + TQuestionAnswerId);
            }
            return(Json(newTutorQuestionAnswerComment));
        }
Esempio n. 8
0
        public IActionResult SubmitTutorQuestionAnswer(long TQuestionId, string description, long UID, long ObjEntityId)
        {
            int x = TutorQuestionDB.SubmitTutorQuestionAnswer(TQuestionId, description, UID, ObjEntityId, GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));

            if (x > 0)
            {
                Notify("SubmitedAnswer", "" + TQuestionId);
            }

            return(Json(x));
        }
Esempio n. 9
0
        public IActionResult SubmitTutorQuestion(string title, string description, long tutorId, string tagNames)
        {
            DataTable dtTags = null;

            dtTags = JsonConvert.DeserializeAnonymousType <DataTable>(tagNames, dtTags);
            int x = TutorQuestionDB.SubmitTutorQuestion(title, description, tutorId, dtTags, GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));

            if (x > 0)
            {
                Notify("AddedQuestion", "" + x);
            }
            return(Json(x));
        }
Esempio n. 10
0
        public IActionResult Follow(long TQuestionId, long UID, int ObjEntityId)
        {
            int x = TutorQuestionDB.Follow(TQuestionId, UID, ObjEntityId, GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));

            if (x == 1)
            {
                Notify("Follow");
            }
            else if (x == -1)
            {
                Notify("Unfollow");
            }
            return(Json(x));
        }
Esempio n. 11
0
        public IActionResult GetTutorQuestions(int pageNumber = 1, int pageSize = 5, long UID = 0, long tutorId = 0, int selectType = 1)
        {
            QAResponse <List <TutorQuestion> > response = TutorQuestionDB.GetTutorQuestions(pageNumber, pageSize, UID, tutorId, selectType, GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));

            return(Json(response));
        }
Esempio n. 12
0
        public IActionResult GetAllQuestions(int pageNumber = 1, int pageSize = 5, long UID = 0, string tag = "")
        {
            QAResponse <List <TutorQuestion> > response = TutorQuestionDB.GetAllTutorQuestions(pageNumber, pageSize, UID, tag, GetConfiguration().GetConnectionString(DEFAULT_CONNECTION));

            return(Json(response));
        }