public bool UpdateState2(Model.dt_msg md) { StringBuilder strSql = new StringBuilder(); strSql.Append("update dt_msg set "); strSql.Append("ISPROCESSED=@ISPROCESSED,"); strSql.Append("REMARK=@REMARK"); strSql.Append(" where id=@id"); SqlParameter[] parameters = { new SqlParameter("@ISPROCESSED", SqlDbType.Bit, 1), new SqlParameter("@REMARK", SqlDbType.NVarChar, 1000), new SqlParameter("@id", SqlDbType.NVarChar, 36) }; parameters[0].Value = md.ISPROCESSED; parameters[1].Value = md.REMARK; parameters[2].Value = md.id; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
public Model.BaseResponse UpdateMemo(Model.dt_msg item) { Model.BaseResponse res = new BaseResponse(); if (!dal.UpdateState2(item)) { res.error = 1; res.data = "更新失败,请稍候重试"; } return(res); }