private JsonResult saveSecQuestion(SecQuestion secQuestion, string command) { Response response = new Response(); SecQuestionDataHandler secQuestionDataHandler = new SecQuestionDataHandler(config); secQuestionDataHandler.queId = secQuestion.queId; secQuestionDataHandler.userId = secQuestion.userId; secQuestionDataHandler.question = secQuestion.question; secQuestionDataHandler.answer = secQuestion.answer; if (command.Equals("create")) { response.status = secQuestionDataHandler.createSecQuestion(); } return(Json(response)); }
public JsonResult getSecQuestion(int userId) { Response response = new Response(); SecQuestionDataHandler secQuestionDataHandler = new SecQuestionDataHandler(config); try { SecQuestion secQuestion = secQuestionDataHandler.getSecQuestion(userId); response.data = JsonConvert.SerializeObject(secQuestion); response.status = true; } catch (Exception ex) { response.status = false; response.message = ex.Message; } return(Json(response)); }