/// <summary> /// 修改手机号 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button7_Click(object sender, EventArgs e) { dt_Dyn_UpdateMemberShip_req updates = new dt_Dyn_UpdateMemberShip_req(); ZCRMT322_Dyn z = new ZCRMT322_Dyn(); z.DATA_SOURCE = AppConfig.DATA_SOURCE; z.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌 z.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统 z.VGROUP = AppConfig.VGROUP; //销售组织 z.MOB_NUMBER = "18954152811"; z.ACCOUNT_ID = "13681885237"; z.PARTNER = "MCHM000000036"; updates.ZCRMT316 = new ZCRMT322_Dyn[] { z }; dt_Dyn_UpdateMemberShip_res ups = WebHmjApiHelp.UpdateMemberShip(updates, true); }
/// <summary> /// 绑定成功修改状态 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button6_Click(object sender, EventArgs e) { dt_Dyn_UpdateMemberShip_req updates = new dt_Dyn_UpdateMemberShip_req(); ZCRMT322_Dyn z = new ZCRMT322_Dyn(); z.DATA_SOURCE = AppConfig.DATA_SOURCE; z.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌 z.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统 z.VGROUP = AppConfig.VGROUP; //销售组织 z.WECHATNAME = "昵称"; z.WECHATFOLLOWSTATUS = "1"; z.OPENID = "sdjflajslkfd"; z.ACCOUNT_ID = "18952435467"; z.PARTNER = "MCHM000000003"; updates.ZCRMT316 = new ZCRMT322_Dyn[] { z }; dt_Dyn_UpdateMemberShip_res ups = WebHmjApiHelp.UpdateMemberShip(updates, true); }
/// <summary> /// 完善信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button11_Click(object sender, EventArgs e) { dt_Dyn_UpdateMemberShip_req updates = new dt_Dyn_UpdateMemberShip_req(); ZCRMT322_Dyn z = new ZCRMT322_Dyn(); //大宝生日 z.KID_BIRTHDAY = "1992-12-23"; //二宝生日 z.KID_BIRTHDAY2 = "1992-12-10"; //从事行业 z.ZC019 = "4"; //收入范围 z.ZC004 = "06"; //何处了解华美家 z.INFO_WANTED = "001,002"; //婚姻状况 z.ZC016 = "01"; //品牌编号 z.BRAND_PREF = "01,02,03"; //皮肤特征 z.ZA003 = "01"; //皮肤问题 z.ZA004 = "02,03"; //品牌 编号 z.BRAND_PREF = ""; //品类编号 z.CLASS_PREF = ""; z.DATA_SOURCE = AppConfig.DATA_SOURCE; z.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌 z.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统 z.VGROUP = AppConfig.VGROUP; //销售组织 z.ACCOUNT_ID = "18952435467"; z.PARTNER = "MCHM000000003"; updates.ZCRMT316 = new ZCRMT322_Dyn[] { z }; dt_Dyn_UpdateMemberShip_res ups = WebHmjApiHelp.UpdateMemberShip(updates, true); }
/// <summary> /// 修改会员详细信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button5_Click(object sender, EventArgs e) { dt_Dyn_UpdateMemberShip_req updates = new dt_Dyn_UpdateMemberShip_req(); ZCRMT322_Dyn z = new ZCRMT322_Dyn(); z.DATA_SOURCE = AppConfig.DATA_SOURCE; z.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌 z.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统 z.VGROUP = AppConfig.VGROUP; //销售组织 z.NAME_LAST = "苗*"; z.NAME_FIRST = "玉凯*"; z.NAME1_TEXT = "苗+玉凯"; z.XSEX = "2"; z.PSTREET = "修改的地址"; z.ACCOUNT_ID = "18952435467"; z.PARTNER = "MCHM000000003"; updates.ZCRMT316 = new ZCRMT322_Dyn[] { z }; dt_Dyn_UpdateMemberShip_res ups = WebHmjApiHelp.UpdateMemberShip(updates, true); }
/// <summary> /// 修改会员常规信息 /// </summary> /// <param name="name"></param> /// <param name="gender"></param> /// <param name="address"></param> /// <param name="opendID"></param> /// <returns></returns> public int UpdateMember(string NAME_LAST, string NAME_FIRST, string gender, string address, string opendID) { //查询会员主数据信息 CUST_MEMBER member = _repo.GetMemberByOpenId(opendID); dt_Dyn_UpdateMemberShip_req updates = new dt_Dyn_UpdateMemberShip_req(); ZCRMT322_Dyn z = new ZCRMT322_Dyn(); z.DATA_SOURCE = "0002"; z.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌 z.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统 z.VGROUP = AppConfig.VGROUP; //销售组织 z.NAME_LAST = NAME_LAST; z.NAME_FIRST = NAME_FIRST; z.NAME1_TEXT = NAME_LAST + NAME_FIRST; z.XSEX = gender == "0" ? "1" : "2"; //1女2男 z.PSTREET = address; //z.MOB_NUMBER = mobile; z.ACCOUNT_ID = member.MEMBERNO; z.PARTNER = member.PARTNER; updates.ZCRMT316 = new ZCRMT322_Dyn[] { z }; dt_Dyn_UpdateMemberShip_res ups = WebApiHelp.UpdateMemberShip(updates); if (ups.WV_RETURN == "Y") { return(1); } else { return(2); } }
/// <summary> /// 修改会员扩展信息 /// </summary> /// <param name="request"></param> private string UpdateMemberExtend(MemberExtendDTO request, string mobile, ref string flg) { dt_Dyn_UpdateMemberShip_req updates = new dt_Dyn_UpdateMemberShip_req(); ZCRMT322_Dyn z = new ZCRMT322_Dyn { //大宝生日 KID_BIRTHDAY = request.KID_BIRTHDAY, //二宝生日 KID_BIRTHDAY2 = request.KID_BIRTHDAY2, //从事行业 ZC019 = request.ZC019, //收入范围 ZC004 = request.ZC004, ZC016 = request.ZC016, //婚姻状况 BRAND_PREF = request.BRAND_PREF, //"01,02,03";//品牌编号 ZA003 = request.ZA003, //"01";//皮肤特征 ZA004 = request.ZA004, //"02,03";//皮肤问题 CLASS_PREF = request.CLASS_PREF, //品类编号 DATA_SOURCE = AppConfig.DATA_SOURCE, LOYALTY_BRAND = AppConfig.LOYALTY_BRAND, //忠诚度品牌 SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM, //来源系统 VGROUP = AppConfig.VGROUP, //销售组织 REGION = request.REGION, //省编号 TRANSPZONE = request.TRANSPZONE, //市编号 INFO_WANTED = request.INFO_WANTED, //"001,002";//何处了解华美家 ACCOUNT_ID = mobile, //"18952435467"; PARTNER = request.PARTNER // "MCHM000000003"; }; updates.ZCRMT316 = new ZCRMT322_Dyn[] { z }; dt_Dyn_UpdateMemberShip_res ups = WebHmjApiHelp.UpdateMemberShip(updates); flg = ups.WV_RETURN; #region 完善资料送积分 2018.03.29 23:59:59停止使用 //if (flg == "Y") //{ // bool bo = _hmjMember.SendPoint(request); // if (bo) // { // #region 微信模板消息 2018.03.29 23:59:59停止使用 // //接口查询会员主数据,用于模板消息中的内容填充 // //dt_Dyn_DispMember_req w = new dt_Dyn_DispMember_req(); // //w.DATA_SOURCE = AppConfig.DATA_SOURCE; // //w.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND;//忠诚度品牌 // //w.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM;//来源系统 // //w.VGROUP = AppConfig.VGROUP; //销售组织 // //w.PARTNER = request.PARTNER;//会员唯一标示 // //dt_Dyn_DispMember_res dt = WebHmjApiHelp.DispMember(w); // //if (dt.ZCRMT316 == null || dt.ZCRMT316.Length <= 0) // //{ // // return null; // //} // //if (dt.ZCRMT316.Length > 1) // //{ // // return null; // //} // //ZCRMT302_Dyn newmeber = dt.ZCRMT316[0]; // //var openid = request.OPENID; // //var tempId = "nJqLvWytZJ2IUBdOapJ3RQcJjD3Zvt0UYdvQ1A-5IQ8"; // //var redirect_url = AppConfig.HmjWebApp + "assets/hmjweixin/html/hytq.html"; // //var p1 = "恭喜您完善资料成功!"; // //var p2 = DateTime.Now.ToString("yyyy年MM月dd日"); // //var p3 = AppConfig.MemberSend.Split('|')[0]; // //var p4 = "完善资料成功"; // //var p5 = newmeber.ZCCUR_POINT.ToString(); // //var p6 = "今后您可获得更多积分、享受更多优惠。了解更多会员权益,点击查看 >"; // //_hmjMember.SendTmpPublicFunc(true, openid, tempId, redirect_url, // // p1, p2, p3, p4, p5, p6); // #endregion // } //} #endregion return(ups.WV_MESSAGE); }
/// <summary> /// 修改会员手机或兑礼密码, /// </summary> /// <param name="mobile">新手机号</param> /// <param name="oldmobile">旧的手机号</param> /// <param name="pwd">新密码</param> /// <param name="oldpwd">旧密码</param> /// <returns></returns> public int UpdateMobileOrPwd(string mobile, string oldmobile, string pwd, string oldpwd, string OpendID, ref string msg) { //查询会员主数据信息 CUST_MEMBER member = _repo.GetMemberByOpenId(OpendID); //修改手机号 if (!string.IsNullOrEmpty(mobile) && !string.IsNullOrEmpty(oldmobile)) { //修改手机号 dt_Dyn_UpdateMemberShip_req updates = new dt_Dyn_UpdateMemberShip_req(); ZCRMT322_Dyn z = new ZCRMT322_Dyn { DATA_SOURCE = AppConfig.DATA_SOURCE, LOYALTY_BRAND = AppConfig.LOYALTY_BRAND, //忠诚度品牌 SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM, //来源系统 VGROUP = AppConfig.VGROUP, //销售组织 MOB_NUMBER = mobile, ACCOUNT_ID = member.MEMBERNO, PARTNER = member.PARTNER }; updates.ZCRMT316 = new ZCRMT322_Dyn[] { z }; dt_Dyn_UpdateMemberShip_res ups = WebApiHelp.UpdateMemberShip(updates); if (ups.WV_RETURN == "Y") { return(1); } else { msg = ups.WV_MESSAGE; return(2); } } //修改密码 if (!string.IsNullOrEmpty(pwd) && !string.IsNullOrEmpty(oldpwd)) { dt_Dyn_ChangePassword_req piq = new dt_Dyn_ChangePassword_req { DATA_SOURCE = AppConfig.DATA_SOURCE, //SOURCE ZVTWEG = "102", ACCOUNT_ID = member.MEMBERNO, //EXTERNAL_CARD_NU EXCHANGEPASS = oldpwd, EXCHANGEPASS2 = pwd, PASS_TYPE = "2", REASON = "兑礼密码修改", INIT_FLAG = "", LOYALTY_BRAND = AppConfig.LOYALTY_BRAND, //忠诚度品牌 SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM, //来源系统 VGROUP = AppConfig.VGROUP //销售组织 }; //修改CRM端密码 dt_Dyn_ChangePassword_res res = WebApiHelp.ChangePassword(piq); if (res.ZRETURN == "Y") { //修改本地密码 CUST_MEMBER mebers = new CUST_MEMBER() { ID = member.ID, LOGINPASSON = pwd }; //更新本地会员信息 int count = _repo.UpdateMember(mebers); return(1); } else { return(2); } } return(0); }
/// <summary> /// 绑定会员 /// </summary> /// <param name="mobile"></param> /// <returns></returns> public string BindMember(string mobile, string openid, string Nickname) { using (TransScope scope = new TransScope()) { WXCUST_FANS fans = _repo.GetFans(openid); if (fans == null) { return("3"); } CUST_MEMBER member = _repo.GetMemberByMobile(mobile, fans.ID); if (member != null) { return("2"); } #region 记录会员 dt_Dyn_DispMember_req w = new dt_Dyn_DispMember_req(); w.DATA_SOURCE = "0002"; w.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌 w.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统 w.VGROUP = AppConfig.VGROUP; //销售组织 w.MOB_NUMBER = mobile; //2002652891 dt_Dyn_DispMember_res dt = WebApiHelp.DispMember(w); if (dt.ZCRMT316 == null || dt.ZCRMT316.Count() <= 0) { return("4"); } if (dt.ZCRMT316.Count() > 1) { return("5"); } ZCRMT302_Dyn meber = dt.ZCRMT316[0]; CUST_MEMBER mebers = new CUST_MEMBER() { ADDRESS = meber.PSTREET, AVA_POINTS = (int?)meber.ZCCUR_POINT, BIRTHDAY = string.IsNullOrEmpty(meber.BIRTHDT) ? null : (DateTime?)DateTime.Parse(meber.BIRTHDT), CITY = "", COUNTRY = "", CREATE_DATE = DateTime.Now, CREATE_USER = "******", EMAIL = meber.CSMTP_ADDR, FANS_ID = fans.ID, GENDER = meber.XSEX == "2" ? true : false, MEMBERNO = meber.ACCOUNT_ID, MEM_LEVEL = meber.ZTIER, MOBILE = mobile, STATUS = 1, STORE = meber.ZH003, NAME = meber.NAME1_TEXT, PARTNER = meber.PARTNER, TYPE = meber.DATA_SOURCE == "0001" ? 0 : 1 }; double counts = _repo.Insert(mebers); #endregion //如果绑定成功需要告诉crm已经绑定 if (counts > 0) { //绑定接口 dt_Dyn_UpdateMemberShip_req updates = new dt_Dyn_UpdateMemberShip_req(); ZCRMT322_Dyn z = new ZCRMT322_Dyn(); z.DATA_SOURCE = "0002"; z.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌 z.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统 z.VGROUP = AppConfig.VGROUP; //销售组织 z.WECHATNAME = Nickname; z.WECHATFOLLOWSTATUS = "1"; z.OPENID = openid; z.ACCOUNT_ID = dt.ZCRMT316[0].ACCOUNT_ID; z.PARTNER = dt.ZCRMT316[0].PARTNER; updates.ZCRMT316 = new ZCRMT322_Dyn[] { z }; dt_Dyn_UpdateMemberShip_res ups = WebApiHelp.UpdateMemberShip(updates); //如果是待激活状态那么就要激活 if (meber.ZZAFLD000004 == "E0005") { //激活 this.ChageSatus(meber.ACCOUNT_ID); } //绑定成功送三百积分 if (fans.IS_REGISTER == null || fans.IS_REGISTER == 0) { #region 注册送积分 //如果注册会员成功送积分 //si_Dyn_ActCreateTel_obService == si_ActCreateTel_obService dt_Dyn_ActCreateTel_req Actreq = new dt_Dyn_ActCreateTel_req(); // 数据源类型 Actreq.TYPE = "0002"; //处理标识 Actreq.OBJECT_ID = DateTime.Now.ToString("yyyyMMddHHmmss") + CommonHelp.GetRand(10); //活动单据类型 Actreq.PROCESS_TYPE = "ZXY"; //外部会员卡号 "会员卡号(如已传输手机号,可不用填写会员卡号)" Actreq.ACCOUNT_ID = meber.ACCOUNT_ID; Actreq.POSTING_DATE = DateTime.Today.ToString(); //积分类型 Actreq.POINT_TYPE = "ZBCJF01"; //积分数 要改 Actreq.POINTS = decimal.Parse(AppConfig.POINTS); //单据全局活动ID Actreq.CAMPAIGN_HE_ID = "CMP2820171023005"; Actreq.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌 Actreq.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统 Actreq.VGROUP = AppConfig.VGROUP; //销售组织 dt_Dyn_ActCreateTel_res Actres = WebApiHelp.ActCreateTel(Actreq); string remak = string.Empty; if (Actres.I_ZCRMT047_dyn[0].CHECK_FLAG == "N") { remak = "新注册会员送积分失败,原因:" + Actres.I_ZCRMT047_dyn[0].MESSAGE; } #endregion string str = _repo.UpdateIsRegion(fans.ID); } } scope.Commit(); return("1"); } }