private string SaveArticle(string input) { if (string.IsNullOrEmpty(input)) { return(new MyHttpResult(false, "入参不符合要求").ToString()); } ArticleModel artM = JsonExtensions.FromJson <ArticleModel>(input); MyHttpResult myRtn; if (artM.id == 0) { var user = (UserModel)Public.User_Info; artM.createby = user.id; artM.create_user = user.nickname; artM.create_date = DateTime.Now; myRtn = new MyHttpResult(artM.Insert() > 0 ? true : false, ""); } else { ArticleModel artM_old = (new ArticleBLL()).GetModel(artM.id); artM_old.title = artM.title; artM_old.art_type = artM.art_type; artM_old.content = artM.content; artM_old.ispublish = artM.ispublish; artM_old.description = (string.IsNullOrEmpty(artM.description) ? artM_old.description : artM.description); myRtn = new MyHttpResult((new ArticleBLL()).Update(artM_old) > 0 ? true : false, ""); } return(myRtn.ToString()); }