public JsonResult GetReplyaToEdit(string replyId) { string res = ""; if (!string.IsNullOrEmpty(replyId)) { ReplyBL rBl = new ReplyBL(); int replyID = Convert.ToInt32(replyId); Replys replys = rBl.GetReplyaToEdit(replyID); return(Json(replys, JsonRequestBehavior.AllowGet)); } return(Json("", JsonRequestBehavior.AllowGet)); }
// Forum public JsonResult GetReplyForAQuestions(string questionID) { ReplyBL rBl = new ReplyBL(); if (!string.IsNullOrEmpty(questionID)) { int quesID = Convert.ToInt32(questionID); List <Replys> replys = rBl.GetReplyForAQuestions(quesID); return(Json(replys, JsonRequestBehavior.AllowGet)); } else { return(Json("No replies found for the selected question", JsonRequestBehavior.AllowGet)); } }
public JsonResult DeleteAReply(string replyId) { string res = ""; if (!string.IsNullOrEmpty(replyId)) { ReplyBL rBl = new ReplyBL(); int replyID = Convert.ToInt32(replyId); res = rBl.DeleteAReply(replyID); if (res == "1") { return(Json("Deleted Reply Successfully!!", JsonRequestBehavior.AllowGet)); } } return(Json(res, JsonRequestBehavior.AllowGet)); }
public JsonResult PostReply(string QuestionId, string Reply) { string res = ""; if (!string.IsNullOrEmpty(QuestionId) && !string.IsNullOrEmpty(Reply)) { ReplyBL rBl = new ReplyBL(); int quesId = Convert.ToInt32(QuestionId); res = rBl.InsertIntoReply(quesId, Reply); if (res == "1") { return(Json("Replied Successfully!!", JsonRequestBehavior.AllowGet)); } } return(Json(res, JsonRequestBehavior.AllowGet)); }