/// <summary> /// 微信关注传输 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button13_Click(object sender, EventArgs e) { dt_Dyn_WechatStateTran_req req = new dt_Dyn_WechatStateTran_req(); req.OPENID = "openidtest"; req.NEW_STATE = "2";//1:已关注 2:取消关注 0::未关注 req.DATA_SOURCE = AppConfig.DATA_SOURCE; req.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌 req.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统 req.VGROUP = AppConfig.VGROUP; //销售组织 dt_Dyn_WechatStateTran_res res = WebHmjApiHelp.WechatStateTran(req, true); }
/// <summary> /// 关注信息传输 /// </summary> /// <param name="req"></param> /// <returns></returns> public static dt_Dyn_WechatStateTran_res WechatStateTran(dt_Dyn_WechatStateTran_req req, bool isdebug = false) { string reqStr = js.Serialize(req); string resStr = string.Empty; DateTime?timeStart = null; DateTime?timeEnd = null; string isok = "OK"; try { timeStart = DateTime.Now; logger.Info("关注信息传输si_Dyn_WechatStateTran_obService请求信息:" + reqStr); si_Dyn_WechatStateTran_obService web = new si_Dyn_WechatStateTran_obService(); dt_Dyn_WechatStateTran_res res = web.si_Dyn_WechatStateTran_ob(req); resStr = js.Serialize(res); timeEnd = DateTime.Now; logger.Info("响应信息" + resStr + "\r\n"); if (res == null) { isok = "NO"; } return(res); } catch (Exception ex) { resStr = ex.Message; isok = "NO"; return(null); } finally { if (!isdebug) { datalog.DataInfo(reqStr, resStr, timeStart, timeEnd, 0, SystemCode.WechatStateTran.ToString(), isok); } } }
/// <summary> /// 关注/取关 /// </summary> /// <param name="req"></param> /// <returns></returns> public static dt_Dyn_WechatStateTran_res WechatStateTran(dt_Dyn_WechatStateTran_req req) { try { string reqStr = js.Serialize(req); DateTime timeStart = DateTime.Now; logger.Info("微信关注数据传输si_Dyn_WechatStateTran_obService请求信息:" + reqStr); si_Dyn_WechatStateTran_obService web = new si_Dyn_WechatStateTran_obService(); dt_Dyn_WechatStateTran_res res = web.si_Dyn_WechatStateTran_ob(req); string resStr = js.Serialize(res); DateTime timeEnd = DateTime.Now; logger.Info("响应信息" + resStr + "\r\n"); datalog.DataInfo(reqStr, resStr, timeStart, timeEnd, 0, "si_Dyn_WechatStateTran_obService", "微信关注数据传输"); return(res); } catch (Exception ex) { throw new Exception(ex.Message); } }