public FeedBackInfo Get(string feedBackID) { FeedBackInfo info = new FeedBackInfo(); DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM vshop_FeedBackNotify WHERE FeedBackId=@FeedBackId"); this.database.AddInParameter(sqlStringCommand, "FeedBackId", DbType.String, feedBackID); using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand)) { return ReaderConvert.ReaderToModel<FeedBackInfo>(reader); } }
public bool Save(FeedBackInfo info) { DbCommand sqlStringCommand = this.database.GetSqlStringCommand("INSERT INTO vshop_FeedBackNotify (AppId, TimeStamp, OpenId, MsgType, FeedBackId, TransId, Reason, Solution, ExtInfo) VALUES (@AppId, @TimeStamp, @OpenId, @MsgType, @FeedBackId, @TransId, @Reason, @Solution, @ExtInfo)"); this.database.AddInParameter(sqlStringCommand, "AppId", DbType.String, info.AppId); this.database.AddInParameter(sqlStringCommand, "TimeStamp", DbType.DateTime, info.TimeStamp); this.database.AddInParameter(sqlStringCommand, "OpenId", DbType.String, info.OpenId); this.database.AddInParameter(sqlStringCommand, "MsgType", DbType.String, info.MsgType); this.database.AddInParameter(sqlStringCommand, "FeedBackId", DbType.String, info.FeedBackId); this.database.AddInParameter(sqlStringCommand, "TransId", DbType.String, info.TransId); this.database.AddInParameter(sqlStringCommand, "Reason", DbType.String, info.Reason); this.database.AddInParameter(sqlStringCommand, "Solution", DbType.String, info.Solution); this.database.AddInParameter(sqlStringCommand, "ExtInfo", DbType.String, info.ExtInfo); return (this.database.ExecuteNonQuery(sqlStringCommand) > 0); }
protected void Page_Load(object sender, EventArgs e) { base.Response.Write("success"); SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); FeedBackNotify feedBackNotify = new NotifyClient(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret, masterSettings.WeixinPartnerID, masterSettings.WeixinPartnerKey, masterSettings.WeixinPaySignKey).GetFeedBackNotify(base.Request.InputStream); if (feedBackNotify != null) { string msgType = feedBackNotify.MsgType; if (msgType != null) { if (!(msgType == "request")) { if (msgType == "confirm") { feedBackNotify.MsgType = "已完成"; } } else { feedBackNotify.MsgType = "未处理"; } } if (VShopHelper.GetFeedBack(feedBackNotify.FeedBackId) != null) { VShopHelper.UpdateFeedBackMsgType(feedBackNotify.FeedBackId, feedBackNotify.MsgType); } else { FeedBackInfo info = new FeedBackInfo { AppId = feedBackNotify.AppId, ExtInfo = feedBackNotify.ExtInfo, FeedBackId = feedBackNotify.FeedBackId, MsgType = feedBackNotify.MsgType, OpenId = feedBackNotify.OpenId, Reason = feedBackNotify.Reason, Solution = feedBackNotify.Solution, TransId = feedBackNotify.TransId }; VShopHelper.SaveFeedBack(info); } } }
public static bool SaveFeedBack(FeedBackInfo info) { return new FeedBackDao().Save(info); }