protected void Page_Load(object sender, EventArgs e) { WxMaterialData Wx = new WxMaterialData(); WxMaterial wmater = Wx.logGetidinfo(" SalePromoteTypeid !=4 order by operatime desc "); int totalcount = 0; if (wmater != null) { Listtime = wmater.Operatime.ToString("yyyy-MM-dd"); } ////判断如果是否为手机访问 //if (detectmobilebrowser.HttpUserAgent(Request.ServerVariables["HTTP_USER_AGENT"])) //{ // if (Request["brow"]=="PC")//如果接收到传递PC访问则只PC版 // { // Cookie.WriteCookie("Mobile_Brow_Set", "PC"); // } // // //查看COOKIE 是否设定是否设定为PC // if (Cookie.GetCookie("Mobile_Brow_Set") == "PC") // { // } // else // { // Response.Redirect("/M/Default.aspx?brow=MO"); // } //} if (Session["AccountId"] != null) { //账户信息 AccountId = Int32.Parse(Session["AccountId"].ToString()); AccountName = Session["AccountName"].ToString(); AccountCard = Session["AccountCard"].ToString(); RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower(); B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl); if (companyinfo != null) { comid = companyinfo.Com_id; } if (comid != 101) { Response.Redirect("/ui/shangjiaui/ProductList.aspx"); } //会员信息 B2bCrmData dateuser = new B2bCrmData(); B2b_crm modeluser = dateuser.Readuser(AccountId, comid); if (modeluser != null) { AccountWeixin = modeluser.Weixin; AccountEmail = modeluser.Email; Accountphone = modeluser.Phone; Servercard = modeluser.Servercard; Imprest = modeluser.Imprest; Integral = modeluser.Integral; //密码 AccountPass = modeluser.Password1; //微信关注 weixin = modeluser.Weixin == "" ? "未关注" : "已关注"; } //渠道 MemberChannelData channeldate = new MemberChannelData(); //渠道信息 Member_Channel channelmodel = channeldate.GetSelfChannelDetailByCardNo(AccountCard); if (channelmodel != null) { channeltype = 1; channelid = channelmodel.Id; RebateConsume = channelmodel.RebateConsume; RebateOpen = channelmodel.RebateOpen; Opencardnum = channelmodel.Opencardnum; Firstdealnum = channelmodel.Firstdealnum; Summoney = channelmodel.Summoney; } //服务专员信息,服务专员ID if (Servercard != 0) { Member_Channel channelmode2 = channeldate.GetChannelDetail(Int32.Parse(Servercard.ToString())); if (channelmode2 != null) { Servername = channelmode2.Name; Servermobile = channelmode2.Mobile; } } //菜单项new WxSalePromoteTypeData() List <WxSalePromoteType> menulist = new WxSalePromoteTypeData().GetAllWxMaterialType(comid, out totalcount); if (comid == 101) { List <WxSalePromoteType> list = new List <WxSalePromoteType>(); int[] i = { 0, 1, 2, 5, 12 }; foreach (int s in i) { WxSalePromoteType wxmaterial = new WxSalePromoteType(); wxmaterial.Id = menulist[s].Id; wxmaterial.Typename = menulist[s].Typename; list.Add(wxmaterial); } menu.DataSource = list; menu.DataBind(); } else { menu.DataSource = menulist; menu.DataBind(); } } else { Response.Redirect("/V/card.aspx"); } }
//读取用户信息 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; 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(); if (Accountphone != "") { var channel_temp = new MemberChannelData().GetChannelid(userinfo.Com_id, Accountphone); if (channel_temp != 0) { unchannel = 1; //标注为渠道 } } string a = AccountCard.Substring(0, 1); if (a != null) { fcard = int.Parse(a.ToString()); } //获取预付款记录 B2bFinanceData fdate = new B2bFinanceData(); int totalcount = 0; var list = fdate.ImprestList(1, 10, comid, out totalcount, userinfo.Id); if (list != null) { Imprestlist = "<ul>"; for (int i = 0; i < list.Count; i++) { if (list[i].Money < 0) { Imprestlist += "<li>" + list[i].Subdate + " 支出:" + list[i].Money.ToString("0.00") + "元</li>"; } else { Imprestlist += "<li>" + list[i].Subdate + " 获得:" + list[i].Money.ToString("0.00") + "元</li>"; } } Imprestlist += "</ul>"; } //获取积分记录 var integrallist = fdate.IntegralList(1, 10, comid, out totalcount, userinfo.Id); if (integrallist != null) { Integrallist = "<ul>"; for (int i = 0; i < integrallist.Count; i++) { if (integrallist[i].Money < 0) { Integrallist += "<li>" + integrallist[i].Subdate + " 支出:" + integrallist[i].Money.ToString("0") + "</li>"; } else { Integrallist += "<li>" + integrallist[i].Subdate + " 获得:" + integrallist[i].Money.ToString("0") + "</li>"; } } Integrallist += "</ul>"; } //消费记录 string proname = ""; string orderstate = ""; B2bOrderData dataorder = new B2bOrderData(); var prodata = new B2bComProData(); var order = dataorder.ConsumerOrderPageList("", 1, 10, userinfo.Id, out totalcount); if (order != null) { Orderlist = "<ul>"; for (int i = 0; i < order.Count; i++) { var promodel = prodata.GetProById(order[i].Pro_id.ToString()); if (promodel != null) { proname = promodel.Pro_name; } orderstate = EnumUtils.GetName((OrderStatus)order[i].Order_state); Orderlist += "<li>" + proname + "(" + order[i].U_subdate + ") " + order[i].U_num + "(" + orderstate + ")</li>"; } Orderlist += "</ul>"; } //当读取用户信息的时候,判断是否有渠道转发信息 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登陆成功,清空微信密码 } //获得渠道发行信息 MemberChannelData channeldate = new MemberChannelData(); Member_Channel channelmodel = channeldate.GetSelfChannelDetailByCardNo(AccountCard); if (channelmodel != null) { channeltype = 1; channelid = channelmodel.Id; RebateConsume = channelmodel.RebateConsume; RebateOpen = channelmodel.RebateOpen; Opencardnum = channelmodel.Opencardnum; Firstdealnum = channelmodel.Firstdealnum; Summoney = channelmodel.Summoney; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["AccountId"] != null) { WxMaterialData Wx = new WxMaterialData(); WxMaterial wmater = Wx.logGetidinfo(" SalePromoteTypeid !=4 order by operatime desc "); int totalcount = 0; if (wmater != null) { Listtime = wmater.Operatime.ToString("yyyy-MM-dd"); } //账户信息 AccountId = Int32.Parse(Session["AccountId"].ToString()); AccountName = Session["AccountName"].ToString(); AccountCard = Session["AccountCard"].ToString(); RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower(); B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl); if (companyinfo != null) { comid = companyinfo.Com_id; } //会员信息 B2bCrmData dateuser = new B2bCrmData(); B2b_crm modeluser = dateuser.Readuser(AccountId, comid); if (modeluser != null) { AccountWeixin = modeluser.Weixin; AccountEmail = modeluser.Email; Accountphone = modeluser.Phone; Servercard = modeluser.Servercard; Imprest = modeluser.Imprest; Integral = modeluser.Integral; //密码 AccountPass = modeluser.Password1; //微信关注 weixin = modeluser.Weixin == "" ? "未关注" : "已关注"; } //渠道 MemberChannelData channeldate = new MemberChannelData(); //渠道信息 Member_Channel channelmodel = channeldate.GetSelfChannelDetailByCardNo(AccountCard); if (channelmodel != null) { channeltype = 1; channelid = channelmodel.Id; RebateConsume = channelmodel.RebateConsume; RebateOpen = channelmodel.RebateOpen; Opencardnum = channelmodel.Opencardnum; Firstdealnum = channelmodel.Firstdealnum; Summoney = channelmodel.Summoney; } //服务专员信息,服务专员ID if (Servercard != 0) { Member_Channel channelmode2 = channeldate.GetChannelDetail(Int32.Parse(Servercard.ToString())); if (channelmode2 != null) { Servername = channelmode2.Name; Servermobile = channelmode2.Mobile; } } ////菜单项new WxSalePromoteTypeData() //List<WxSalePromoteType> menulist = new WxSalePromoteTypeData().GetAllWxMaterialType(comid, out totalcount); //菜单项new WxSalePromoteTypeData() List <WxSalePromoteType> menulist = new WxSalePromoteTypeData().GetRecommendWxMaterialType(comid, out totalcount); if (comid == 101) { List <WxSalePromoteType> list = new List <WxSalePromoteType>(); int[] i = { 0, 1, 2, 5, 12 }; foreach (int s in i) { WxSalePromoteType wxmaterial = new WxSalePromoteType(); wxmaterial.Id = menulist[s].Id; wxmaterial.Typename = menulist[s].Typename; list.Add(wxmaterial); } menu.DataSource = list; menu.DataBind(); } else { menu.DataSource = menulist; menu.DataBind(); } //得到微信会员卡说明和使用门店说明 int ttcount = 0; mcMaterilList = new MemberShipCardMaterialData().GetMCMateralListByComId(comid, out ttcount); } else { Response.Redirect("/byts/login.aspx"); } }