public ActionResult _CommentCase() { string from_uname = Request["from_uname"]; string from_account = Request["from_account"]; string from_uid_type = Request["from_uid_type"]; string topic_id = Request["topic_id"]; string topic_type = Request["topic_type"]; string commentcontent = Request["commentcontent"]; int result = 0; MsSqlDataSource mysqlD = new MsSqlDataSource(); string thum = "";//获取缩略图 if (!String.IsNullOrEmpty(from_account)) { thum = otherService.getPhotoUrlthum(from_account, from_uid_type); } if (thum == "2") { return(Json(new { RetCode = result }, JsonRequestBehavior.AllowGet)); } //插入评论 string comment_guid = Guid.NewGuid().ToString(); string insertStr = string.Format("insert into Z_Comment(topic_id,topic_type,content,from_uname,from_account,from_uid_type,addtime,comment_guid,thum) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}')", topic_id, topic_type, commentcontent, from_uname, from_account, from_uid_type, DateTime.Now.ToString("yyyy-MM-dd"), comment_guid, thum); result = mysqlD.ExecuteNonQuery(insertStr); Z_Comment comment = new Z_Comment(); if (result > 0) { comment = new Z_Comment { from_uname = from_uname, from_account = from_account, from_uid_type = from_uid_type, content = commentcontent, addtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), thum = thum, comment_guid = comment_guid }; } return(PartialView(comment)); }