Ejemplo n.º 1
0
 public HttpResponseMessage Insert(SystemDictionaryDomain model)
 {
     if (!ModelState.IsValid)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.Forbidden, ModelState));
     }
     else
     {
         ItemResponse <int> response = new ItemResponse <int>();
         response.Item = systemDicionaryService.Insert(model);
         return(Request.CreateResponse(HttpStatusCode.OK, response));
     }
 }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="requestModel"></param>
        /// <returns></returns>
        public ActionResult Insert(AddSystemDictionaryRequestModel requestModel)
        {
            var ret = _systemDictionaryService.Insert(requestModel);

            return(Content(ret.ToJsonString()));
        }