예제 #1
0
        public ActionResult DeleteQuestion(int ID, ref string recordCount)
        {
            QuestionBL topicBL        = new QuestionBL();
            int        recordaffected = topicBL.DeleteQuestion(ID, ref recordCount);

            return(Json(recordaffected, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public JsonResult DeleteQuestion(string questionID)
        {
            QuestionBL bl     = new QuestionBL();
            int        quesID = Convert.ToInt32(questionID);
            string     res    = bl.DeleteQuestion(quesID);

            if (res == "1")
            {
                return(Json("Successfully Deleted!!", JsonRequestBehavior.AllowGet));
            }
            return(Json(res, JsonRequestBehavior.AllowGet));
        }
        public async Task <IHttpActionResult> DeleteQuestion(int id)
        {
            QuestionBL bL = new QuestionBL(_context);

            if (!bL.QuestionExists(id))
            {
                return(NotFound());
            }
            var result = await bL.DeleteQuestion(id);

            if (result == null)
            {
                return(InternalServerError());
            }

            return(Ok(result));
        }