public ActionResult SaveRegist(AnswerModels item) {
            item.HiddenFlg = false;
            item.AnswerUsername = "******";
            item.AnswerDatetime = DateTime.Now;
            item.UpdateDatetime = DateTime.Now;
            item.UpdateUsername = "******";

            AnswerServices answerServices = new AnswerServices();
            answerServices.insert(item);

            QuestionServices questionServices = new QuestionServices();
            questionServices.Id = item.QuestionId.ToString();
            List<QuestionModels> lst = questionServices.select(-1, -1);
            if(lst != null && lst.Count > 0){
                QuestionModels questionInfo = new QuestionModels();
                questionInfo =  lst.First();
                questionInfo.HiddenFlg = false;
                questionInfo.QuestionDatetime = DateTime.Now;
                questionServices = new QuestionServices();
                questionServices.update(questionInfo);
            }

            return Redirect("/admin/question/answer?questionid=" + item.QuestionId.ToString());
        }
 public ActionResult ChangeState(QuestionViewhelper questionViewhelper)
 {
     if (Session.getCurrentUser() == null)
         return Redirect("/admin/account/logon");
     if (!SercurityServices.HasPermission((int)TypeModule.MODULE_HOIDAP, Session.getCurrentUser().username, TypeAudit.Delete))
     {
         return Redirect("/admin/error/error403");
     }
     QuestionServices questionService;
     if (questionViewhelper.CheckID != null && questionViewhelper.CheckID.Length > 0)
     {
         foreach (var id in questionViewhelper.CheckID)
         {
             questionService = new QuestionServices();
             questionService.Id = id.ToString();
             List<QuestionModels> lstCmt = questionService.select(-1, -1);
             if (lstCmt != null && lstCmt.Count > 0)
             {
                 QuestionModels item = lstCmt.First();
                 item.HiddenFlg = questionViewhelper.ChangeState;
                 questionService.update(item);
             }
         }
     }
     saveData(questionViewhelper);
     return View("Index");
 }
 public ActionResult SaveEdit(QuestionModels item)
 {
     QuestionServices serives = new QuestionServices();
     int rs = serives.update(item);
     return Redirect("Index");
 }