public int Add(Feedback_log mode) { using (var Conn = new MySqlConnection(DbHelperMySQL.connectionString)) { StringBuilder strSql = new StringBuilder(); strSql.Append("INSERT INTO `feedback_log`(UserID,Title,Content,GameLog,Datetime,image)"); strSql.Append(" VALUES(@UserID, @Title, @Content, @GameLog,@Datetime,@image)"); //"insert into login_log("); // strSql.Append("id,openid,login_time,login_state)"); // strSql.Append(" values ("); // strSql.Append("@id,@openid,@login_time,@login_state)"); return(Conn.Execute(strSql.ToString(), mode)); } }
public void ExecuteCommand(GameSession session, ProtobufRequestInfo requestInfo) { //if (!Gongyong.userlist.Any(w => w.session.SessionID.Equals(session.SessionID))) //{ // session.Logger.Debug("非法连接"); // session.Close(); // return; //} var sendInfo = SendFeedback.ParseFrom(requestInfo.Body); RedisLoginModel olduser = RedisUtility.Get <RedisLoginModel>(RedisUtility.GetKey(GameInformationBase.COMMUNITYUSERLIST, sendInfo.Openid, sendInfo.Unionid)); if (olduser == null) { session.Close(); return; } Feedback_log fb = new Feedback_log(); fb.UserID = sendInfo.UserID; fb.Title = sendInfo.Title; if (sendInfo.HasContent) { fb.Content = sendInfo.Content; } fb.Datetime = DateTime.Now; if (sendInfo.HasGameLog) { fb.GameLog = sendInfo.GameLog; } if (sendInfo.HasImage) { fb.image = sendInfo.Image; } new FeedbackDAL().Add(fb); }