public string update(string post) { InsertPetitionPostData postData = post.FromJsonTo <InsertPetitionPostData>(); if (this.Lazy_PetitionBLL.UpdatePetition(postData.petition, postData.pics)) { return(new Result() { Code = 0, Data = null }.ToJSON()); } else { return(new Result() { Code = 100, Data = null, Message = "发生错误" }.ToJSON()); } }
public string postPetition(string post) { InsertPetitionPostData postData = post.FromJsonTo <InsertPetitionPostData>(); int newId = this.Lazy_PetitionBLL.InsertPetition(postData.petition, postData.pics); if (newId != -1) { return(new ResultPost() { Code = 0, PetitionId = newId }.ToJSON()); } else { return(new ResultPost() { Code = 100, PetitionId = newId, Message = "系统错误" }.ToJSON()); } }