示例#1
0
        public JsonResult <APIResultEntities <bool> > Delete(Guid id)
        {
            APIResultEntities <bool> rs = new APIResultEntities <bool>();

            try
            {
                _iQuestionTypeService.DeleteQuestionType(id);
                rs.Data           = true;
                rs.ErrCode        = ErrorCodeEntites.Success;
                rs.ErrDescription = string.Format(Constants.MSG_DELETE_SUCCESS, Constants.QuestionType);
            }
            catch (Exception ex)
            {
                rs.Data           = false;
                rs.ErrCode        = ErrorCodeEntites.Fail;
                rs.ErrDescription = ex.ToString();
            }
            return(Json(rs));
        }
        public JsonResult DeleteQuestionType(Guid id)
        {
            JsonResult result = new JsonResult();

            try
            {
                bool isSuccess = questionTypeService.DeleteQuestionType(id);
                log.Info("删除成功");
            }
            catch (Exception e)
            {
                log.Error(e.Message);
            }
            finally
            {
                result = Json(new { msg = "删除成功" }, JsonRequestBehavior.AllowGet);
            }
            return(result);
        }
 public IHttpActionResult Delete(int id)
 {
     questionTypeService.DeleteQuestionType(id);
     return(Ok(""));
 }