//渠道统计ChannelYk public static string ChannelYk(string comid, int pageindex, int pagesize, string issuetype) { var totalcount = 0; try { var prodata = new MemberChannelData(); var list = prodata.ChannelYk(comid, pageindex, pagesize, issuetype, out totalcount); IEnumerable result = ""; if (list != null) { result = from pro in list select new { Yknum = pro.Com_id, //验卡数量 Companyname = pro.Channeltypename //门市名称 } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string Upchannl(int id, int comid, decimal channlcard, decimal oldcard, int uptype) { try { var pro = ""; //获得渠道ID var Channeinfo = new MemberChannelData().GetSelfChannelDetailByCardNo(channlcard.ToString()); B2bCrmData crmdate = new B2bCrmData(); var Userinfo = crmdate.Readuser(id, comid); if (Channeinfo != null && Userinfo != null) { pro = new MemberChannelData().UpchannlT(Userinfo.Cardid, Channeinfo.Id, uptype); } return(JsonConvert.SerializeObject(new { type = 100, msg = pro })); } catch (Exception e) { return(JsonConvert.SerializeObject(new { type = 1, msg = e.Message })); } }
//判断是否跳转 private void GetMenshiDetail(string openid, int comid) { Member_Channel channel = new MemberChannelData().GetChannelByOpenId(openid); if (channel == null) { errlog = "获得渠道为空"; } else { //渠道单位类型:0:内部渠道;1:外部渠道;3:网站注册;4:微信注册 if (channel.Issuetype == 0)//会员属于门店 { channelcompanytype = channel.Issuetype.ToString(); //根据微信号得到会员所在的门市信息 Member_Channel_company menshi = new MemberChannelcompanyData().GetMenShiByJumpId(openid, comid); if (menshi != null) { if (menshi.Whetherdepartment == 0) { //如果不是内部部门,显示门店列表 channelcompanyid = menshi.Id; //Response.Redirect("StoreDefault.aspx?menshiid=" + channelcompanyid); } } } else//会员属于公司 { channelcompanytype = Request["issuetype"].ConvertTo <string>("0,3,4"); channelcompanyid = 0; } } }
//当客户的渠道为0时,随机自动分配一个渠道编号(优先未锁定用户的),sendtype= 当为1的时候 有渠道也发送,一般是点击我的顾问时候发送,0=则是留言的时候变更渠道发送 public static int GetFenpeiChannel(int comid, string openid, int sendtype = 1, int companyid = 0, int channleid = 0) { var crmdata = new B2bCrmData(); MemberCardData carddata = new MemberCardData(); var channeldata = new MemberChannelData();//读取渠道信息 decimal idcard = 0; decimal channelid = 0; var userinfo_auto = carddata.GetMemberCardByOpenId(openid);;//获取微信操作账户 if (userinfo_auto != null) { idcard = userinfo_auto.Cardcode;; channelid = userinfo_auto.IssueCard;//获取渠道ID } //判断对 微信注册,网站注册渠道进行归0 var channeltype = channeldata.GetChannelDetail(int.Parse(channelid.ToString())); if (channeltype != null) { if (channeltype.Issuetype == 3 || channeltype.Issuetype == 4 || channeltype.Name == "默认渠道") {//如果渠道时微信注册或网站注册,渠道ID归0,下面自动重新分配有效渠道 channelid = 0; } } return(int.Parse(channelid.ToString())); }
//判断是否跳转 private void GetMenshiDetail(string openid, int comid) { Member_Channel channel = new MemberChannelData().GetChannelByOpenId(openid); if (channel == null) { //errlog = "获得渠道为空"; } else { //渠道单位类型:0:内部渠道;1:外部渠道;3:网站注册;4:微信注册 if (channel.Issuetype == 0 || channel.Issuetype == 1)//会员属于门店 { //根据微信号得到会员所在的门市信息 Member_Channel_company menshi = new MemberChannelcompanyData().GetMenShiByJumpId(openid, comid); if (menshi != null) { if (menshi.Whetherdepartment == 0) { //如果不是内部部门,显示门店列表 Response.Redirect("/H5/storedetail.aspx?menshiid=" + menshi.Id); } } } else//会员属于公司 { // channelcompanyid = 0; } } }
//当客户的渠道为0时,随机自动分配一个渠道编号(优先未锁定用户的),sendtype= 当为1的时候 有渠道也发送,一般是点击我的顾问时候发送,0=则是留言的时候变更渠道发送 public static int AutoFenpeiChannel(int comid, string openid, int sendtype = 1, int companyid = 0, int channleid = 0) { var crmdata = new B2bCrmData(); MemberCardData carddata = new MemberCardData(); var channeldata = new MemberChannelData();//读取渠道信息 decimal idcard = 0; decimal channelid = 0; var userinfo_auto = carddata.GetMemberCardByOpenId(openid);;//获取微信操作账户 if (userinfo_auto != null) { idcard = userinfo_auto.Cardcode;; channelid = userinfo_auto.IssueCard;//获取渠道ID } //判断对 微信注册,网站注册渠道进行归0 var channeltype = channeldata.GetChannelDetail(int.Parse(channelid.ToString())); if (channeltype != null) { if (channeltype.Issuetype == 3 || channeltype.Issuetype == 4 || channeltype.Name == "默认渠道") {//如果渠道时微信注册或网站注册,渠道ID归0,下面自动重新分配有效渠道 channelid = 0; } } if (channelid == 0) { //查询在线渠道列表, int totalcount = 0; //在线数量 var channellist = channeldata.GetChannelListByComid(comid, companyid, 2, out totalcount, channleid); //先查询渠道列表 锁定客户为空的 if (channellist != null) { if (totalcount > 0) { //随机选择一个渠道 Random rand = new Random(); var channel_temp = channellist[rand.Next(0, totalcount - 1)]; var channelid_temp = channel_temp.Id; //绑定渠道 int upchannel = new MemberCardData().upCardcodeChannel(idcard.ToString(), channelid_temp); channelid = channelid_temp; } } //只有变更时才发送顾问信息 Sendweixinchient(openid, comid); } else { //点击顾问也发送 if (sendtype == 1) { Sendweixinchient(openid, comid); } } return(int.Parse(channelid.ToString())); }
//读取用户信息 private void Readuser(decimal idcard, int comid) { //Today = DateTime.Now.ToString("yyyy-MM-dd"); B2bCrmData dateuser = new B2bCrmData(); var userinfo = dateuser.GetB2bCrmByCardcode(idcard); if (userinfo != null) { uid = userinfo.Id; //Integral = userinfo.Integral.ToString() == "" ? "0" : userinfo.Integral.ToString(); //Imprest = userinfo.Imprest.ToString() == "" ? "0" : userinfo.Imprest.ToString(); //AccountWeixin = userinfo.Weixin; //AccountEmail = userinfo.Email; //Accountphone = userinfo.Phone; //AccountCard = userinfo.Idcard.ToString(); //string a = AccountCard.Substring(0, 1); //if (a != null) //{ // fcard = int.Parse(a.ToString()); //} //当读取用户信息的时候,判断是否有渠道转发信息 if (Request.Cookies["ZF_ChanneId"] != null) { int ZF_ChanneId = 0; ZF_ChanneId = int.Parse(Request.Cookies["ZF_ChanneId"].Value); if (ZF_ChanneId != 0) { //有转发渠道ID //在这判断 用户渠道是否为微信注册过来的 Member_Channel channel2 = new MemberChannelData().GetChannelByOpenId(userinfo.Weixin); if (channel2 != null) { if (channel2.Issuetype == 4) { //如果为微信注册过来的 ,则修改会员渠道即可 int upchannel = new MemberCardData().upCardcodeChannel(userinfo.Idcard.ToString(), ZF_ChanneId); } } else { //没有渠道的 ,则修改会员渠道即可 int upchannel = new MemberCardData().upCardcodeChannel(userinfo.Idcard.ToString(), ZF_ChanneId); } //清除Cookies HttpCookie aCookie = new HttpCookie("ZF_ChanneId"); aCookie.Expires = DateTime.Now.AddDays(-1); Response.Cookies.Add(aCookie); } } dateuser.WeixinConPass(userinfo.Weixin, comid);//只要包含SESSION登陆成功,清空微信密码 } }
public static string SearchActivityList(string comid, int pageindex, int pagesize, string key, string ServerName, int userid) { var totalcount = 0; bool isNum = Domain_def.RegexValidate("^[0-9]*$", key); try { var list = new List <Member_Activity_Log>(); B2b_company_manageuser userr = B2bCompanyManagerUserData.GetUser(userid); if (userr != null) { if (userr.Channelcompanyid == 0)//总公司账户 { list = new B2bCrmData().SearchActivityList(comid, pageindex, pagesize, key, ServerName, isNum, out totalcount); } else //总公司下面渠道 { list = new B2bCrmData().SearchActivityList(comid, pageindex, pagesize, key, ServerName, isNum, int.Parse(userr.Channelcompanyid.ToString()), out totalcount); } IEnumerable result = ""; var memcompany = new MemberChannelcompanyData(); if (list != null) { result = from pro in list select new { ID = pro.ID, CardID = MemberCardData.GetCardId(pro.CardID).Cardcode, //CardID =pro.CardID, ACTID = MemberActivityData.GetActById(pro.ACTID).Title, OrderId = pro.OrderId, ServerName = pro.ServerName, Sales_admin = pro.Sales_admin, Num_people = pro.Num_people, Usesubdate = pro.Usesubdate, Per_capita_money = pro.Per_capita_money * pro.Num_people, Member_return_money = pro.Member_return_money, username = B2bCrmData.GetCrmCardcode(MemberCardData.GetCardId(pro.CardID).Cardcode) == null ? "--" : B2bCrmData.GetCrmCardcode(MemberCardData.GetCardId(pro.CardID).Cardcode).Name.ToString(), channel = MemberChannelData.GetChannelinfo(int.Parse(MemberCardData.GetCardNumber(MemberCardData.GetCardId(pro.CardID).Cardcode).IssueCard.ToString())) == null ? "--" : memcompany.GetCompanyById(MemberChannelData.GetChannelinfo(int.Parse(MemberCardData.GetCardNumber(MemberCardData.GetCardId(pro.CardID).Cardcode).IssueCard.ToString())).Companyid).Companyname.ToString() } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } else { return(JsonConvert.SerializeObject(new { type = 1, msg = "" })); } } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public string Servermobile = ""; //服务专员手机 protected void Page_Load(object sender, EventArgs e) { openid = Request["openid"]; weixinpass = Request["weixinpass"]; //如果SESSION有值,进行赋值 if (openid != "" && Session["Openid"] != null) { openid = Session["Openid"].ToString(); } //获得商户ID RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower(); B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl); if (companyinfo != null) { comid = companyinfo.Com_id; Session["Com_id"] = comid; } //已登录直接跳转 if (Session["AccountId"] != null) { AccountId = Int32.Parse(Session["AccountId"].ToString()); B2bCrmData dateuser1 = new B2bCrmData(); B2b_crm modeluser = dateuser1.Readuser(AccountId, comid); if (modeluser != null) { AccountWeixin = modeluser.Weixin; AccountEmail = modeluser.Email; Accountphone = modeluser.Phone; AccountName = modeluser.Name; AccountCard = modeluser.Idcard.ToString(); Servercard = modeluser.Servercard; Integral = modeluser.Integral; Imprest = modeluser.Imprest; } //服务专员信息,服务专员ID if (Servercard != 0) { MemberChannelData channeldate = new MemberChannelData(); Member_Channel channelmode2 = channeldate.GetChannelDetail(Int32.Parse(Servercard.ToString())); if (channelmode2 != null) { Servername = channelmode2.Name; Servermobile = channelmode2.Mobile; } } } }
//读取用户信息 private void Readuser(decimal idcard, int comid) { //Today = DateTime.Now.ToString("yyyy-MM-dd"); B2bCrmData dateuser = new B2bCrmData(); var userinfo = dateuser.GetB2bCrmByCardcode(idcard); if (userinfo != null) { AccountId = userinfo.Id; userid = userinfo.Id.ToString(); //如果是登陆用户则读取用户的实际ID HttpCookie cookie = new HttpCookie("temp_userid"); //实例化HttpCookie类并添加值 cookie.Value = userinfo.Id.ToString(); cookie.Expires = DateTime.Now.AddDays(365); Response.Cookies.Add(cookie); var channeldata = new MemberChannelData(); channelid = channeldata.GetChannelid(userinfo.Com_id, userinfo.Phone); //当读取用户信息的时候,判断是否有渠道转发信息 if (Request.Cookies["ZF_ChanneId"] != null) { int ZF_ChanneId = 0; ZF_ChanneId = int.Parse(Request.Cookies["ZF_ChanneId"].Value); if (ZF_ChanneId != 0) { //有转发渠道ID //在这判断 用户渠道是否为微信注册过来的 Member_Channel channel2 = new MemberChannelData().GetChannelByOpenId(userinfo.Weixin); if (channel2 != null) { if (channel2.Issuetype == 4) { //如果为微信注册过来的 ,则修改会员渠道即可 int upchannel = new MemberCardData().upCardcodeChannel(userinfo.Idcard.ToString(), ZF_ChanneId); } } else { //没有渠道的 ,则修改会员渠道即可 int upchannel = new MemberCardData().upCardcodeChannel(userinfo.Idcard.ToString(), ZF_ChanneId); } //清除Cookies HttpCookie aCookie = new HttpCookie("ZF_ChanneId"); aCookie.Expires = DateTime.Now.AddDays(-1); Response.Cookies.Add(aCookie); } } dateuser.WeixinConPass(userinfo.Weixin, comid);//只要包含SESSION登陆成功,清空微信密码 } }
public decimal rebatemoney = 0; //渠道返佣余额 protected void Page_Load(object sender, EventArgs e) { if (UserHelper.ValidateLogin()) { Member_Channel m = new MemberChannelData().GetChannelByMasterId(UserHelper.CurrentUserId()); if (m != null) { channelid = m.Id; rebatemoney = m.Rebatemoney; } } }
public static string GetChannelByCompanyid(string companyid) { try { var list = new MemberChannelData().GetChannelByCompanyid(companyid); return(JsonConvert.SerializeObject(new { type = 100, msg = list })); } catch (Exception e) { return(JsonConvert.SerializeObject(new { type = 1, msg = e.Message })); } }
public static string GetChannelDetail(int channelid) { try { var channelobj = new MemberChannelData().GetChannelDetail(channelid); return(JsonConvert.SerializeObject(new { type = 100, msg = channelobj })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); } }
/// <summary> /// 公用录入单卡号方法 result:录入成功返回cardid,错误返回错误原因 /// </summary> /// <returns></returns> public static bool CommonEnterCardNumber(int issueid, decimal cardnumber, int comid, out string result, Member_Issue issue) { Member_Card cardinfo = new MemberCardData().GetCardByCardNumber(cardnumber); //判断卡号是否存在属于此次发行的卡片类型 int cardtype = cardinfo.Crid; int issuecardtype = issue.Crid; if (cardtype != issuecardtype) { result = "输入的卡号所属类型和发行需要的卡号类型不相符"; return(false); } Member_Channel channel = new MemberChannelData().GetChannelDetail(issue.Chid); List <Member_Issue_Activity> actlist = new MemberIssueActivityData().GetIssuePromot(issueid); try { var upMemberCardd = new MemberCardData().UPChannelCardCode(channel.Id, cardnumber, issueid);//更改生成卡号表中卡号所属渠道的id和发行id foreach (Member_Issue_Activity issueact in actlist) { Member_Card_Activity cardactinfo = new MemberCardActivityData().GetCardActInfo(cardinfo.Id, issueact.Acid); //防止一张卡重复录入同一次活动 if (cardactinfo == null) { Member_Card_Activity cardact = new Member_Card_Activity() { Id = 0, ACTID = issueact.Acid, Actnum = 1, CardID = cardinfo.Id, USEstate = (int)MemberCardUserState.NotUse, USEsubdate = DateTime.Parse("1900-01-01") }; var insertcardact = new MemberCardActivityData().EditMemberCardActivity(cardact); } } result = upMemberCardd.ToString(); return(true); } catch (Exception ex) { new SqlHelper().Dispose(); result = "意外错误"; return(false); throw; } }
public static string Channellistbycomid(string comid, int pageindex, int pagesize) { var totalcount = 0; try { var list = new List <Member_Channel>(); list = new MemberChannelData().Channellistbycomid(comid, pageindex, pagesize, out totalcount); IEnumerable result = ""; if (list != null) { result = from pro in list select new { Id = pro.Id, Com_id = pro.Com_id, Issuetype = pro.Issuetype, ////CompanyName = new MemberChannelcompanyData().GetCompanyById(pro.Companyid).Companyname, CompanyName = pro.Issuetype == 3 ? "网站渠道" : (pro.Issuetype == 4 ? "微信渠道" : new MemberChannelcompanyData().GetCompanyById(pro.Companyid) == null ? "--" : new MemberChannelcompanyData().GetCompanyById(pro.Companyid).Companyname), Name = pro.Name, Mobile = pro.Mobile, ChObjects = pro.ChObjects, Cardcode = pro.Cardcode, Chaddress = pro.Chaddress, RebateOpen = pro.RebateOpen, RebateConsume = pro.RebateConsume, RebateConsume2 = pro.RebateConsume2, RebateLevel = pro.RebateLevel == 0 ? "普通" : "暂时未设", //添加录入量,开卡量,第一次交易量,金额 OpenCardNum = pro.Opencardnum, Firstdealnum = pro.Firstdealnum, Summoney = pro.Summoney, companyid = pro.Companyid, EnterCardNum = new MemberCardData().GetEnteredNumberByChannelId(pro.Id) } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
//读取用户信息 private void Readuser(decimal idcard, int comid) { //Today = DateTime.Now.ToString("yyyy-MM-dd"); B2bCrmData dateuser = new B2bCrmData(); var userinfo = dateuser.GetB2bCrmByCardcode(idcard); if (userinfo != null) { //当读取用户信息的时候,判断是否有渠道转发信息 if (Request.Cookies["ZF_ChanneId"] != null) { int ZF_ChanneId = 0; ZF_ChanneId = int.Parse(Request.Cookies["ZF_ChanneId"].Value); if (ZF_ChanneId != 0) { //有转发渠道ID //在这判断 用户渠道是否为微信注册过来的 Member_Channel channel2 = new MemberChannelData().GetChannelByOpenId(userinfo.Weixin); if (channel2 != null) { if (channel2.Issuetype == 4) { //如果为微信注册过来的 ,则修改会员渠道即可 int upchannel = new MemberCardData().upCardcodeChannel(userinfo.Idcard.ToString(), ZF_ChanneId); } } else { //没有渠道的 ,则修改会员渠道即可 int upchannel = new MemberCardData().upCardcodeChannel(userinfo.Idcard.ToString(), ZF_ChanneId); } //清除Cookies HttpCookie aCookie = new HttpCookie("ZF_ChanneId"); aCookie.Expires = DateTime.Now.AddDays(-1); Response.Cookies.Add(aCookie); } } //读取渠道商户名称 var channelcompany = new MemberChannelcompanyData().GetChannelCompanyByCrmId(userinfo.Id); if (channelcompany != null) { tel = channelcompany.Companyphone; } dateuser.WeixinConPass(userinfo.Weixin, comid);//只要包含SESSION登陆成功,清空微信密码 } }
protected void Page_Load(object sender, EventArgs e) { comid = Request["comid"].ConvertTo <int>(0); md5info = Request["md5info"].ConvertTo <string>(""); string companyName = new B2bCompanyData().GetCompanyNameById(comid); string Returnmd5 = EncryptionHelper.ToMD5(comid.ToString() + "lixh1210", "UTF-8"); if (Returnmd5 == md5info)//验证MD5 { //ExcelRender.RenderToExcel( // ExcelSqlHelper.ExecuteDataTable(CommandType.Text, "select idcard [会员卡号], name [姓名],phone [手机],email [邮件],imprest [预付款],Integral [积分],regidate [注册时间] from b2b_crm where com_id=" + comid), // Context, companyName + "会员信息" + ".xls"); DataTable crmdt = ExcelSqlHelper.ExecuteDataTable(CommandType.Text, "select idcard [会员卡号], name [姓名],phone [手机],email [邮件],imprest [预付款],Integral [积分],regidate [注册时间] from b2b_crm where com_id=" + comid); DataTable dt = new DataTable(); dt.Columns.Add("会员卡号"); dt.Columns.Add("姓名"); dt.Columns.Add("手机"); dt.Columns.Add("邮件"); dt.Columns.Add("预付款"); dt.Columns.Add("积分"); dt.Columns.Add("注册时间"); dt.Columns.Add("渠道单位"); dt.Columns.Add("推荐人"); DataRow dr = dt.NewRow(); foreach (DataRow rr in crmdt.Rows) { dr = dt.NewRow(); dr["会员卡号"] = rr["会员卡号"].ToString(); dr["姓名"] = rr["姓名"].ToString(); dr["手机"] = rr["手机"].ToString(); dr["邮件"] = rr["邮件"].ToString(); dr["预付款"] = rr["预付款"].ToString(); dr["积分"] = rr["积分"].ToString(); dr["注册时间"] = rr["注册时间"].ToString(); dr["渠道单位"] = new MemberChannelcompanyData().UpCompanyById(rr["会员卡号"].ToString()); dr["推荐人"] = MemberChannelData.SearchNamestring(rr["会员卡号"].ToString()); dt.Rows.Add(dr); } ExcelRender.RenderToExcel(dt, Context, companyName + "会员信息" + ".xls"); } }
public static string MasterpagelistByComId(string employstate, int pageindex, int pagesize, string comid, int userid, string key = "") { var totalcount = 0; var memberdata = new MemberChannelData(); MemberChannelcompanyData channel = new MemberChannelcompanyData(); try { var list = new B2bCompanyManagerUserData().Manageuserpagelist(employstate, comid, pageindex, pagesize, out totalcount, userid, key); IEnumerable result = ""; if (list != null) { result = from model in list select new { model.Id, Accounts = model.Accounts, PassWord = model.Passwords, MasterId = model.Id, MasterName = model.Employeename, CompanyName = channel.GetCompanyById(Int32.Parse(model.Channelcompanyid.ToString())) != null?channel.GetCompanyById(Int32.Parse(model.Channelcompanyid.ToString())).Companyname : "", Tel = model.Tel, GroupName = new Sys_MasterGroupData().GetGroupNameStrByMasterId(model.Id), Employstate = model.Employeestate, weixinstate = memberdata.GetChannelListByComidState(int.Parse(comid), model.Id), Peoplelistview = model.Peoplelistview, Workdays = model.Workdays, Isdefaultkf = model.Isdefaultkf, Channelid = new MemberChannelData().GetChannelid(model.Com_id, model.Tel), //渠道id rebatenum = new Member_channel_rebatelogData().Getrebatenum(model.Com_id, model.Tel), //返佣次数 rebateapplytotal = new Member_channel_rebateApplylogData().Getrebateapplytotal(model.Com_id, model.Tel), //返佣申请总额 rebatehastixian = new Member_channel_rebateApplylogData().Getrebatehastixian(model.Com_id, model.Tel), //返佣申请已提现金额 rebatenottixian = new Member_channel_rebateApplylogData().Getrebatenottixian(model.Com_id, model.Tel), //返佣申请尚未提现金额 restrebate = new MemberChannelData().Getrestrebate(model.Com_id, model.Tel), //剩余可申请返佣金额 } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string EditChannel(Member_Channel channel) { try { var id = new MemberChannelData().EditChannel(channel); return(JsonConvert.SerializeObject(new { type = 100, msg = id })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); } }
public static string EconfirmCard(int aid, int actid, int cardid, int comid, out Member_Activity actinfo, out string phone, out string name, out decimal idcard, out decimal agcardcode) { try { MemberCardData carddate = new MemberCardData(); var pro = carddate.EconfirmCard(aid, actid, cardid, comid, out actinfo, out phone, out name, out idcard, out agcardcode); Member_Channel channel = new MemberChannelData().GetChannelDetailByCardNo(idcard.ToString());//根据卡号得到所属渠道的详细信息 if (channel != null) { //给渠道表中 开卡数量和总金额赋值 channel.Firstdealnum = channel.Firstdealnum + 1; channel.Summoney = channel.Summoney + channel.RebateConsume; var channeldata = new MemberChannelData().EditChannel(channel); //把返佣日志录入渠道返佣日志表 ChannelRebateLog channelrebatelog = new ChannelRebateLog() { Id = 0, Channelid = channel.Id, Execdate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")), Rebatemoney = channel.RebateConsume, Type = (int)ChannelRebateType.FirstDeal, Summoney = channel.Summoney, Remark = "消费返佣" + channel.RebateConsume + "元" }; var channelrebatelogret = new ChannelRebateLogData().EditChannelRebateLog(channelrebatelog); } return(JsonConvert.SerializeObject(new { type = 100, actinfo = actinfo, phone = phone, name = name, idcard = idcard, agcardcode = agcardcode, msg = pro })); } catch (Exception ex) { actinfo = null; phone = ""; name = ""; idcard = 0; agcardcode = 0; return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string Readuser(int id, int comid) { try { var prodata = new B2bCrmData(); var list = prodata.Readuser(id, comid); var rename = MemberChannelData.GetChannelinfo(int.Parse(MemberCardData.GetCardNumber(list.Idcard).IssueCard.ToString())); var memcard = MemberChannelData.GetChannelinfo(int.Parse(MemberCardData.GetCardNumber(list.Idcard).ServerCard.ToString())); return(JsonConvert.SerializeObject(new { type = 100, msg = list, Namechannl = rename, Mem = memcard })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
/// <summary> /// 获得渠道名称 /// </summary> /// <param name="channelunitid"></param> /// <returns></returns> public string GetChannelNameById(string channelid) { if (channelid == "0" || channelid == "") { return(""); } else { Member_Channel channel = new MemberChannelData().GetChannelDetail(int.Parse(channelid)); if (channel == null) { return(""); } else { return(channel.Name); } } }
/// <summary> /// 获得渠道单位名称 /// </summary> /// <param name="channelunitid"></param> /// <returns></returns> public string GetChannelUnitNameById(string channelunitid) { if (channelunitid == "0" || channelunitid == "") { return(""); } else { Member_Channel_company channelunit = new MemberChannelData().GetChannelCompanyById(int.Parse(channelunitid)); if (channelunitid == null) { return(""); } else { return(channelunit.Companyname); } } }
public static string fuwuPageList(string comid, int pageindex, int pagesize, int user) { var totalcount = 0; try { var prodata = new B2bCrmData(); var list = prodata.fuwuPageList(comid, pageindex, pagesize, user, out totalcount); IEnumerable result = ""; var memcompany = new MemberChannelcompanyData(); if (list != null) { result = from pro in list select new { id = pro.Id, comid = pro.Com_id, phone = pro.Phone, registerdate = pro.Regidate, customername = pro.Name, imprest = pro.Imprest, integral = pro.Integral, idcard = pro.Idcard, email = pro.Email, serverid = pro.Servercard, winxin = pro.Weixin == null || pro.Weixin == "" ? "" : "yes", channel = memcompany.UpCompanyById(pro.Idcard.ToString()), referrer = MemberChannelData.Upstring(pro.Idcard.ToString()).Name.ToString() } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string Channelstatistics2(string comid, int pageindex, int pagesize, string issuetype, string companystate, int channelcompanyid = 0) { var totalcount = 0; try { var prodata = new MemberChannelData(); var list = prodata.Channelstatistics2(comid, pageindex, pagesize, issuetype, companystate, out totalcount, channelcompanyid); IEnumerable result = ""; if (list != null) { result = from pro in list select new { //添加录入量,开卡量,第一次交易量,金额 OpenCardNum = pro.Opencardnum, //开卡 Firstdealnum = pro.Firstdealnum, //第一次录入量 Summoney = pro.Summoney, //金额 Channelname = pro.Channeltypename, Companyid = pro.Companyid, Companynum = pro.Companynum, Companystate = pro.Companystate // companyid = pro.Companyid,// // companyname = pro.Companyid == 0 ? "微信网站注册" : new MemberChannelcompanyData().GetCompanyById(pro.Companyid).Companyname, //ID = pro.Id } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public string userid = "0";//用户临时 Uid 或 实际Uid public void Page_Load(object sender, EventArgs e) { string u = Request.ServerVariables["HTTP_USER_AGENT"]; bool bo = detectmobilebrowser.HttpUserAgent(u); uid = Request["uid"].ConvertTo <int>(0); //获取IP地址 uip = CommonFunc.GetRealIP(); key = Request["key"].ConvertTo <string>(""); if (key != "") { biaoti = key; } proclass = Request["class"].ConvertTo <int>(0); price = Request["price"].ConvertTo <int>(0); //获取随机用户ID if (Request.Cookies["temp_userid"] != null) { userid = Request.Cookies["temp_userid"].Value; } else { userid = Domain_def.HuoQu_Temp_UserId(); //Response.Cookies("userid").val(); HttpCookie cookie = new HttpCookie("temp_userid"); //实例化HttpCookie类并添加值 cookie.Value = userid; cookie.Expires = DateTime.Now.AddDays(365); Response.Cookies.Add(cookie); } if (proclass != 0) { var prodata = new B2bComProData(); var result = prodata.Proclassbyid(proclass); if (result != null) { biaoti = result.Classname; } } buyuid = Request["buyuid"].ConvertTo <int>(0); tocomid = Request["tocomid"].ConvertTo <int>(0); if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { //先通过正则表达式获取COMid comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString()); } if (comid == 0)//如果非标准格式,查询 是否有绑定的域名 { var domaincomid = B2bCompanyData.GetComId(RequestUrl); if (domaincomid != null) { comid = domaincomid.Com_id; } } if (comid != 0) { var commodel = B2bCompanyData.GetCompany(comid); if (commodel != null) { if (commodel.B2bcompanyinfo != null) { Wxfocus_url = commodel.B2bcompanyinfo.Wxfocus_url; Wxfocus_author = commodel.B2bcompanyinfo.Wxfocus_author; weixinname = commodel.B2bcompanyinfo.Weixinname; Scenic_intro = commodel.B2bcompanyinfo.Scenic_intro; } title = commodel.Com_name; } B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (pro != null) { if (pro.Smalllogo != null && pro.Smalllogo != "") { comlogo = FileSerivce.GetImgUrl(pro.Smalllogo.ConvertTo <int>(0)); } } //获取微信平台端code string weixincode = Request["code"].ConvertTo <string>(""); //获取微信号和一次性密码 openid = Request["openid"].ConvertTo <string>(""); string weixinpass = Request["weixinpass"].ConvertTo <string>(""); //获得会员信息 GetCrmInfo(weixincode, openid, weixinpass); } //获取BANNER,及logo if (comid != 0) { var imagedata = new B2bCompanyImageData(); int totalcount = 0; List <B2b_company_image> list = imagedata.PageGetimageList(comid, 2, out totalcount); if (list != null) { for (int i = 0; i < totalcount; i++) { bannerimg = FileSerivce.GetImgUrl(list[i].Imgurl); bannerlink = list[i].Linkurl; bannertitle = list[i].Title; } } //根据公司id得到 直销设置 B2b_company_saleset saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (saleset != null) { logoimg = FileSerivce.GetImgUrl(saleset.Smalllogo.ConvertTo <int>(0)); } //读取首页栏目,只读取前10个栏目,太多影响打开 var shopmenudata = new B2bCompanyMenuData(); menulist = shopmenudata.GetMenuList(comid, 1, 10, out menutotalcount, 1); if (menulist != null) { for (int i = 0; i < menutotalcount; i++) { menulist[i].Imgurl_address = FileSerivce.GetImgUrl(menulist[i].Imgurl); } } } //微信转发访问归属渠道 if (uid != 0)//必须记录转发用户信息才能继续统计 { //判断有转发人的渠道 var crmdata = new B2bCrmData(); var pro = crmdata.Readuser(uid, comid);//读取转发人用户信息 string zhuanfa_phone = ""; if (pro != null) { zhuanfa_phone = pro.Phone; } if (zhuanfa_phone != "") { //转发人手机存在 MemberChannelData channeldata = new MemberChannelData(); var channeinfo = channeldata.GetPhoneComIdChannelDetail(zhuanfa_phone, comid); //查询渠道 if (channeinfo != null) { //转发人渠道记录COOKI HttpCookie cookie = new HttpCookie("ZF_ChanneId"); //实例化HttpCookie类并添加值 cookie.Value = channeinfo.Id.ToString(); cookie.Expires = DateTime.Now.AddDays(120); Response.Cookies.Add(cookie); } } } }
internal WxSubscribeSource Getchannelwxqrcodebychannelid(int channelid) { string sql = "select * from WxSubscribeSource where channelid=" + channelid; //判断渠道是否有二维码 int num = Getqrcodenumbychannelid(channelid); if (num == 0) { int isdefaultchannel = 0; int channelcompanyid = 0; //如果渠道是默认渠道,则查询门店二维码 Member_Channel mcompany = new MemberChannelData().GetChannelDetail(channelid); if (mcompany != null) { if (mcompany.Whetherdefaultchannel == 1) { isdefaultchannel = 1; channelcompanyid = mcompany.Companyid; } } if (isdefaultchannel == 1) { sql = "select * from WxSubscribeSource where channelcompanyid=" + channelcompanyid + " and channelid=0 and channelcompanyid>0"; } } var cmd = sqlHelper.PrepareTextSqlCommand(sql); using (var reader = cmd.ExecuteReader()) { WxSubscribeSource m = null; if (reader.Read()) { m = new WxSubscribeSource { Id = reader.GetValue <int>("id"), Sourcetype = reader.GetValue <int>("sourcetype"), Activityid = reader.GetValue <int>("activityid"), Channelcompanyid = reader.GetValue <int>("channelcompanyid"), viewchannelcompanyid = reader.GetValue <int>("viewchannelcompanyid"), Comid = reader.GetValue <int>("comid"), Ticket = reader.GetValue <string>("ticket"), Title = reader.GetValue <string>("title"), Qrcodeurl = reader.GetValue <string>("qrcodeurl"), Createtime = reader.GetValue <DateTime>("createtime"), Onlinestatus = Convert.IsDBNull(reader.GetValue(9)) == true ? true : reader.GetValue <bool>("onlinestatus"), Channelid = reader.GetValue <int>("channelid"), Productid = reader.GetValue <int>("productid"), qrcodeviewtype = reader.GetValue <int>("qrcodeviewtype"), projectid = reader.GetValue <int>("projectid"), wxmaterialtypeid = reader.GetValue <int>("wxmaterialtypeid"), Wxmaterialid = reader.GetValue <int>("Wxmaterialid"), choujiangactid = reader.GetValue <int>("choujiangactid"), }; } return(m); } }
public int isrightwxset = 1; //微信接口设置信息是否正确 #endregion protected void Page_Load(object sender, EventArgs e) { materialid = Request["materialid"].ConvertTo <int>(0); uid = Request["uid"].ConvertTo <int>(0); //获取IP地址 uip = CommonFunc.GetRealIP(); WxMaterial wxmaterial = new WxMaterialData().GetWxMaterial(materialid); string weixincode = Request["code"].ConvertTo <string>(""); openid = Request["openid"].ConvertTo <string>(""); #region 材信息 if (wxmaterial != null) { authorpayurl = wxmaterial.Authorpayurl; Author = wxmaterial.Author; datetime = wxmaterial.Operatime.ToString("yyyy-MM-dd"); comid = wxmaterial.Comid; id = wxmaterial.MaterialId; title = wxmaterial.Title; thisday = DateTime.Now.ToString("yyyy-MM-dd"); article = wxmaterial.Article; phone_tel = wxmaterial.Phone; Articleurl = wxmaterial.Articleurl; phone = "客服电话:"; price = wxmaterial.Price.ToString(); if (price == "0.00" || price == "0") { price = ""; } else { price = price.IndexOf(".") != -1 ? price.Substring(0, price.IndexOf(".")) : price; price = "¥" + price + "元-"; } summary = wxmaterial.Summary; var identityFileUpload = new FileUploadData().GetFileById(wxmaterial.Imgpath.ToString().ConvertTo <int>(0)); if (identityFileUpload != null) { if (identityFileUpload.Relativepath != "") { headPortraitImgSrc = fileUrl + identityFileUpload.Relativepath; } else { headPortraitImgSrc = ""; } } } #endregion #region 微信转发访问统计 if (uid != 0)//必须记录转发用户信息才能继续统计 { //查询是否有此cookies,有此cooki则证明已经访问过的用户 if (Request.Cookies["wxact" + materialid.ToString()] == null) { var forward = new MemberForwardingData().Forwardingcount(uid, materialid, uip, comid); if (forward > 0) { HttpCookie cookie = new HttpCookie("wxact" + materialid.ToString()); //实例化HttpCookie类并添加值 cookie.Value = "yes"; cookie.Expires = DateTime.Now.AddDays(365); Response.Cookies.Add(cookie); } } //判断有转发人的渠道 var crmdata = new B2bCrmData(); var pro = crmdata.Readuser(uid, comid);//读取转发人用户信息 string zhuanfa_phone = ""; if (pro != null) { zhuanfa_phone = pro.Phone; } if (zhuanfa_phone != "") { //转发人手机存在 MemberChannelData channeldata = new MemberChannelData(); var channeinfo = channeldata.GetPhoneComIdChannelDetail(zhuanfa_phone, comid); //查询渠道 if (channeinfo != null) { //转发人渠道记录COOKI HttpCookie cookie = new HttpCookie("ZF_ChanneId"); //实例化HttpCookie类并添加值 cookie.Value = channeinfo.Id.ToString(); cookie.Expires = DateTime.Now.AddDays(120); Response.Cookies.Add(cookie); cookie = new HttpCookie("ZF_WxmaterialId"); //实例化HttpCookie类并添加值 cookie.Value = materialid.ToString(); cookie.Expires = DateTime.Now.AddDays(120); Response.Cookies.Add(cookie); } } } #endregion if (comid != 0) { #region 微信语音播放接口会用到 string url = Request.Url.ToString(); //根据传入参数openid、comid 得到 access_token、jsapi_ticket、noncestr、timestamp、 url(当前网页的URL,不包含#及其后面部分) WeiXinBasic basic = new WeiXinBasicData().GetWxBasicByComId(comid); if (basic != null) { appId = basic.AppId; timestamp = new WeixinVoiceUtil().CreatenTimestamp(); nonceStr = new WeixinVoiceUtil().CreatenNonce_str(); WXAccessToken maccesstoken = new WeixinVoiceUtil().GetAccessToken(comid, basic.AppId, basic.AppSecret); if (maccesstoken != null) { string jsapi_ticket = new WeixinVoiceUtil().GetTickect(maccesstoken.ACCESS_TOKEN, comid); if (jsapi_ticket == "") { isrightwxset = 0; } else { string beforesha1_signature = ""; signature = new WeixinVoiceUtil().GetSignature(jsapi_ticket, nonceStr, timestamp, url, out beforesha1_signature); } } else { isrightwxset = 0; } } else { isrightwxset = 0; } #endregion var commodel = B2bCompanyData.GetCompany(comid); if (commodel != null) { if (commodel.B2bcompanyinfo != null) { Wxfocus_url = commodel.B2bcompanyinfo.Wxfocus_url; Wxfocus_author = commodel.B2bcompanyinfo.Wxfocus_author; weixinname = commodel.B2bcompanyinfo.Weixinname; Scenic_intro = commodel.B2bcompanyinfo.Scenic_intro; } Com_name = commodel.Com_name; } B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (pro != null) { if (pro.Smalllogo != null && pro.Smalllogo != "") { comlogo = FileSerivce.GetImgUrl(pro.Smalllogo.ConvertTo <int>(0)); } } if (weixincode != "") { int questtype = 2;//1=微信授权验证 DealUserinfo1("", weixincode, comid, questtype); } else if (openid != "") { string weixinpass = Request["weixinpass"].ConvertTo <string>(""); int questtype = 1; //1=一次性密码验证 DealUserinfo1(openid, weixinpass, comid, questtype); //判断用户微信号(1,点击的转发链接进来的2,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的) } } }
public void Page_Load(object sender, EventArgs e) { string u = Request.ServerVariables["HTTP_USER_AGENT"]; bool bo = detectmobilebrowser.HttpUserAgent(u); id = Request["id"].ConvertTo <int>(0); string md5 = Request["md5"].ConvertTo <string>(""); string Returnmd5 = EncryptionHelper.ToMD5(id.ToString() + "lixh1210", "UTF-8"); var orderdata = new B2bOrderData(); var orderinfo = orderdata.GetOrderById(id); if (orderinfo != null) { u_name = orderinfo.U_name; //判断登陆状态 //if (Session["AccountId"] != null) //{ //先判断Session //int AccountId = int.Parse(Session["AccountId"].ToString()); if (Returnmd5 == md5) //必须符合加密的才能打开 { yuyuetime = orderinfo.U_traveldate.ToString("yyyy-MM-dd hh:mm:ss"); var prodata = new B2bComProData(); var proinfo = prodata.GetProById(orderinfo.Pro_id.ToString()); if (proinfo != null) { Pro_name = proinfo.Pro_name; bindiname = proinfo.bookpro_bindname; bindphone = proinfo.bookpro_bindphone; var managedata = new B2bCompanyManagerUserData(); var manageinfo = managedata.GetCompanyUserByPhone(bindphone, proinfo.Com_id); if (manageinfo != null) { bindimg = FileSerivce.GetImgUrl(manageinfo.Headimg); } } } //} } uid = Request["uid"].ConvertTo <int>(0); //获取IP地址 uip = CommonFunc.GetRealIP(); key = Request["key"].ConvertTo <string>(""); if (key != "") { biaoti = key; } proclass = Request["class"].ConvertTo <int>(0); price = Request["price"].ConvertTo <int>(0); if (proclass != 0) { var prodata = new B2bComProData(); var result = prodata.Proclassbyid(proclass); if (result != null) { biaoti = result.Classname; } } //获取随机用户ID if (Request.Cookies["temp_userid"] != null) { userid = Request.Cookies["temp_userid"].Value; } else { userid = Domain_def.HuoQu_Temp_UserId(); //Response.Cookies("userid").val(); HttpCookie cookie = new HttpCookie("temp_userid"); //实例化HttpCookie类并添加值 cookie.Value = userid; cookie.Expires = DateTime.Now.AddDays(365); Response.Cookies.Add(cookie); } buyuid = Request["buyuid"].ConvertTo <int>(0); tocomid = Request["tocomid"].ConvertTo <int>(0); if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { //先通过正则表达式获取COMid comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString()); } if (comid == 0)//如果非标准格式,查询 是否有绑定的域名 { var domaincomid = B2bCompanyData.GetComId(RequestUrl); if (domaincomid != null) { comid = domaincomid.Com_id; } } if (comid != 0) { //根据产品判断商家是否含有自己的微信支付:a.含有的话支付到商家;b.没有的话支付到平台的微信公众号账户中 B2b_finance_paytype model = new B2b_finance_paytypeData().GetFinancePayTypeByComid(comid); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "b"); if (model != null) { //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "c"); //商家微信支付的所有参数都存在 if (model.Wx_appid != "" && model.Wx_appkey != "" && model.Wx_partnerid != "" && model.Wx_paysignkey != "") { //appId = model.Wx_appid; //appsecret = model.Wx_appkey; //appkey = model.Wx_paysignkey; //mchid = model.Wx_partnerid; //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "d"); issetfinancepaytype = true; } } var commodel = B2bCompanyData.GetCompany(comid); if (commodel != null) { if (commodel.B2bcompanyinfo != null) { Wxfocus_url = commodel.B2bcompanyinfo.Wxfocus_url; Wxfocus_author = commodel.B2bcompanyinfo.Wxfocus_author;; weixinname = commodel.B2bcompanyinfo.Weixinname; Scenic_intro = commodel.B2bcompanyinfo.Scenic_intro; } title = commodel.Com_name; } B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (pro != null) { if (pro.Smalllogo != null && pro.Smalllogo != "") { comlogo = FileSerivce.GetImgUrl(pro.Smalllogo.ConvertTo <int>(0)); } } //获取微信平台端code string weixincode = Request["code"].ConvertTo <string>(""); //获取微信号和一次性密码 openid = Request["openid"].ConvertTo <string>(""); string weixinpass = Request["weixinpass"].ConvertTo <string>(""); //获得会员信息 GetCrmInfo(weixincode, openid, weixinpass); } //获取BANNER,及logo if (comid != 0) { //根据公司id得到 直销设置 B2b_company_saleset saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (saleset != null) { logoimg = FileSerivce.GetImgUrl(saleset.Smalllogo.ConvertTo <int>(0)); } } //微信转发访问归属渠道 if (uid != 0)//必须记录转发用户信息才能继续统计 { //判断有转发人的渠道 var crmdata = new B2bCrmData(); var pro = crmdata.Readuser(uid, comid);//读取转发人用户信息 string zhuanfa_phone = ""; if (pro != null) { zhuanfa_phone = pro.Phone; } if (zhuanfa_phone != "") { //转发人手机存在 MemberChannelData channeldata = new MemberChannelData(); var channeinfo = channeldata.GetPhoneComIdChannelDetail(zhuanfa_phone, comid); //查询渠道 if (channeinfo != null) { //转发人渠道记录COOKI HttpCookie cookie = new HttpCookie("ZF_ChanneId"); //实例化HttpCookie类并添加值 cookie.Value = channeinfo.Id.ToString(); cookie.Expires = DateTime.Now.AddDays(120); Response.Cookies.Add(cookie); } } } }
protected void Page_Load(object sender, EventArgs e) { Request.ValidateInput(); string u = Request.ServerVariables["HTTP_USER_AGENT"]; //bool bo = detectmobilebrowser.HttpUserAgent(u); proclass = Request["proclass"].ConvertTo <int>(0); uid = Request["uid"].ConvertTo <int>(0); //获取IP地址 uip = CommonFunc.GetRealIP(); buyuid = Request["buyuid"].ConvertTo <int>(0); tocomid = Request["tocomid"].ConvertTo <int>(0); projectid = Request["id"].ConvertTo <int>(0); pno = Request["pno"].ConvertTo <string>(""); string pno1 = EncryptionHelper.EticketPnoDES(pno, 1);//解密 var B2bEticketdata = new B2bEticketData(); var eticketinfo = B2bEticketdata.GetEticketDetail(pno1); if (eticketinfo != null) { comid = eticketinfo.Com_id; usepnonum = eticketinfo.Use_pnum; } if (comid == 0) { if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl)); } else { B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl); if (companyinfo != null) { comid = companyinfo.Com_id; } } } //微信转发访问归属渠道 if (uid != 0)//必须记录转发用户信息才能继续统计 { //判断有转发人的渠道 var crmdata = new B2bCrmData(); var pro = crmdata.Readuser(uid, comid);//读取转发人用户信息 string zhuanfa_phone = ""; if (pro != null) { zhuanfa_phone = pro.Phone; } if (zhuanfa_phone != "") { //转发人手机存在 MemberChannelData channeldata = new MemberChannelData(); var channeinfo = channeldata.GetPhoneComIdChannelDetail(zhuanfa_phone, comid); //查询渠道 if (channeinfo != null) { //转发人渠道记录COOKI HttpCookie cookie = new HttpCookie("ZF_ChanneId"); //实例化HttpCookie类并添加值 cookie.Value = channeinfo.Id.ToString(); cookie.Expires = DateTime.Now.AddDays(120); Response.Cookies.Add(cookie); } } } //根据项目id得到项目信息 if (projectid != 0) { B2b_com_project mod = new B2b_com_projectData().GetProject(projectid, comid); if (mod != null) { projectname = mod.Projectname; projectimgurl = FileSerivce.GetImgUrl(mod.Projectimg); projectbrief = mod.Briefintroduce; } B2bComProData prodata1 = new B2bComProData(); var prohotel = prodata1.Selectpro_hotel(comid, projectid); if (prohotel == 1) { // Response.Redirect("hotel/hotelshow.aspx?projectid=" + projectid + "&id=" + comid + "&uid =" + uid + "&buyuid=" + buyuid + "&tocomid=" + tocomid + " "); } } if (comid != 0) { B2b_company companyinfo = B2bCompanyData.GetCompany(comid); B2bCompanyInfoData info = new B2bCompanyInfoData(); if (companyinfo != null) { comName = companyinfo.Com_name; if (comName.Length >= 9) { comName = comName.Substring(0, 9) + ".."; } remark = info.GetCompanyInfo(comid).Scenic_intro + " <a style=\"color:#1a9ed9\" href=\"OrderinfoTitle.aspx?id=" + comid + "\">(查看全部)</a>"; if (remark.Length > 42) { remark = remark.Substring(0, 42) + " <a style=\"color:#1a9ed9\" href=\"OrderinfoTitle.aspx?id=" + comid + "\">(查看全部)</a>"; } if (companyinfo.B2bcompanyinfo != null) { Wxfocus_url = companyinfo.B2bcompanyinfo.Wxfocus_url; Wxfocus_author = companyinfo.B2bcompanyinfo.Wxfocus_author;; } } B2b_company_saleset saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (saleset != null) { if (saleset.Smalllogo != null && saleset.Smalllogo != "") { headPortraitImgSrc = FileSerivce.GetImgUrl(saleset.Smalllogo.ConvertTo <int>(0)); } } } //------------------------------新添加代码(主要目的就是获取微信号使用户处于登录状态以及判断用户转发时引发的微信号混乱问题)=========================== string weixincode = Request["code"].ConvertTo <string>(""); if (weixincode == "")//未认证微信 { openid = Request["openid"].ConvertTo <string>(""); weixinpass = Request["weixinpass"].ConvertTo <string>(""); int questtype = 1; //1=一次性密码验证 DealUserinfo1(openid, weixinpass, comid, questtype); //判断用户微信号(1,点击的转发链接进来的2,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的) } else//已认证微信 { int questtype = 2; //1=微信授权验证 DealUserinfo1("", weixincode, comid, questtype); //获取微信号;使用户处于登录状态 } }