public string contact_phone = ""; //联系人电话 protected void Page_Load(object sender, EventArgs e) { comid_temp = Request["comid"].ConvertTo <int>(0); projectid = Request["projectid"].ConvertTo <int>(0); B2b_company companyinfo = B2bCompanyData.GetAllComMsg(comid_temp); if (companyinfo != null) { company = companyinfo.Com_name; contact_phone = companyinfo.B2bcompanyinfo == null ? "" : companyinfo.B2bcompanyinfo.Tel; } if (projectid != 0) { B2b_com_projectData projectdata = new B2b_com_projectData(); var projectinfo = projectdata.GetProject(projectid, comid_temp); if (projectinfo != null) { projectname = projectinfo.Projectname + ": "; } } ishaslvyoubusproorder = new B2bOrderData().IsHasLvyoubusProOrder(comid_temp, (int)ProductServer_Type.LvyouBus); if (Session["Agentid"] != null) { //账户信息 Agentid = Int32.Parse(Session["Agentid"].ToString()); Account = Session["Account"].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { projectid = Request["projectid"].ConvertTo <int>(0); var prodata = new B2b_com_projectData(); if (projectid != 0) { projectname = prodata.GetProjectNameByid(projectid); } }
public string contact_phone = ""; //联系人电话 protected void Page_Load(object sender, EventArgs e) { comid_temp = Request["comid"].ConvertTo <int>(0); projectid = Request["projectid"].ConvertTo <int>(0); B2b_company companyinfo = B2bCompanyData.GetAllComMsg(comid_temp); if (companyinfo != null) { company = companyinfo.Com_name; contact_phone = companyinfo.B2bcompanyinfo == null ? "" : companyinfo.B2bcompanyinfo.Tel; } if (projectid != 0) { B2b_com_projectData projectdata = new B2b_com_projectData(); var projectinfo = projectdata.GetProject(projectid, comid_temp); if (projectinfo != null) { projectname = projectinfo.Projectname + ": "; } } // ishaslvyoubusproorder = new B2bOrderData().IsHasLvyoubusProOrder(comid_temp, (int)ProductServer_Type.LvyouBus); if (Session["Agentid"] != null) { //账户信息 Agentid = Int32.Parse(Session["Agentid"].ToString()); Account = Session["Account"].ToString(); Agent_company agenginfo = AgentCompanyData.GetAgentWarrant(Agentid, comid_temp); if (agenginfo != null) { yufukuan = "您预付款:" + agenginfo.Imprest.ToString("0.00") + " 元"; Warrant_type = agenginfo.Warrant_type; if (Warrant_type == 1) { Warrant_type_str = "销售扣款"; } if (Warrant_type == 2) { Warrant_type_str = "验证扣款"; } } else { Response.Redirect("/Agent/Default.aspx"); } } }
public static string Selhotelprojectlist(int comid) { List <B2b_com_project> list = new B2b_com_projectData().Selhotelprojectlist(comid); if (list.Count > 0) { return(JsonConvert.SerializeObject(new { type = 100, msg = list })); } else { return(JsonConvert.SerializeObject(new { type = 1, msg = "" })); } }
protected void Page_Load(object sender, EventArgs e) { //根据项目id得到项目信息 projectid = Request["id"].ConvertTo <int>(0); B2b_com_project mod = new B2b_com_projectData().GetProject(projectid); if (mod != null) { comid = mod.Comid; projectname = mod.Projectname; projectbrief = mod.Briefintroduce; projectserviceintroduce = mod.Serviceintroduce; } }
public static string Getmenulist(int comid, int pageindex, int pagesize, int usetype = 0, int menuindex = 0) { int totalcount = 0; int totalcount1 = 0; int totalcount2 = 0; int totalcount3 = 0; try { var imagedata = new B2bCompanyMenuData(); var prodata = new B2bComProData(); var actdata = new WxMaterialData(); var projectdata = new B2b_com_projectData(); List <B2b_company_menu> list = imagedata.GetMenuList(comid, pageindex, pagesize, out totalcount, usetype, menuindex); IEnumerable result = ""; if (list != null) { result = from pro in list select new { Id = pro.Id, Com_id = pro.Com_id, Imgurl_address = FileSerivce.GetImgUrl(pro.Imgurl), Imgurl = pro.Imgurl, Linkurl = pro.Linkurl, Name = pro.Name, Fonticon = pro.Fonticon, Usestyle = pro.Usestyle, Menutype = pro.Menutype, Usetype = pro.Usetype, Projectlist = pro.Projectlist, menuindex = pro.menuindex, menuviewtype = pro.menuviewtype, hotellist = pro.menuviewtype == 1 ? projectdata.Projectpagelist(comid.ToString(), 1, 12, "1", out totalcount3, "", 1, pro.Projectlist, 9) : null, prolist = pro.Menutype == 0 ? prodata.Selectpagelist_diaoyong(comid.ToString(), 1, 12, "", out totalcount1, pro.Projectlist, 0, pro.Id) : null,//读出每个栏目的产品,每页12个 Materiallist = pro.Menutype == 0 ? null : actdata.ShopWxMaterialPageList(comid, 1, 12, 10, pro.Id, pro.Projectlist, out totalcount2, "") }; } return(JsonConvert.SerializeObject(new { type = 100, msg = result, totalCount = totalcount })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); } }
protected void Page_Load(object sender, EventArgs e) { projectid = Request["projectid"].ConvertTo <int>(0); B2b_company_manageuser user = UserHelper.CurrentUser(); B2b_company company = UserHelper.CurrentCompany; comid = company.ID; if (projectid == 0) { } else { var projectdata = new B2b_com_projectData(); var projectinfo = projectdata.GetProject(projectid, comid); if (projectinfo != null) { projectname = projectinfo.Projectname; } } }
public static string Selprojectlist(int comid) { List <B2b_com_project> list = new B2b_com_projectData().Selprojectlist(comid); if (list.Count > 0) { IEnumerable result = ""; result = from finance in list select new { Id = finance.Id, Projectname = finance.Projectname }; return(JsonConvert.SerializeObject(new { type = 100, msg = result })); } else { return(JsonConvert.SerializeObject(new { type = 1, msg = "" })); } }
protected void Page_Load(object sender, EventArgs e) { comid = Request["comid"].ConvertTo <int>(0); if (comid > 0) { B2b_company company = new B2bCompanyData().GetCompanyBasicById(comid); //判断公司是否含有项目,不含有的话,添加默认项目 int count = new B2b_com_projectData().GetProjectCountByComId(company.ID); if (count == 0) { B2b_company_info companyinfo = new B2bCompanyInfoData().GetCompanyInfo(company.ID); B2b_company_saleset saleset = B2bCompanySaleSetData.GetDirectSellByComid(company.ID.ToString()); B2b_com_project model = new B2b_com_project() { Id = 0, Projectname = company.Com_name, Projectimg = saleset.Logo.ConvertTo <int>(0), Province = companyinfo.Province.ConvertTo <string>(""), City = companyinfo.City, Industryid = company.Com_type, Briefintroduce = companyinfo.Scenic_intro, Address = companyinfo.Scenic_address, Mobile = companyinfo.Tel, Coordinate = "", Serviceintroduce = companyinfo.Serviceinfo, Onlinestate = "1", Comid = company.ID, Createtime = DateTime.Now, Createuserid = 0 }; int result = new B2b_com_projectData().EditProject(model); //设置公司下产品的项目id都改为默认项目id int result2 = new B2bComProData().UpProjectId(company.ID.ToString(), result); } } }
public string projectbrief = ""; //项目精简介绍 protected void Page_Load(object sender, EventArgs e) { projectid = Request["projectid"].ConvertTo <int>(0); comid = Request["comid"].ConvertTo <int>(0); if (comid > 0 & projectid > 0) { //根据项目id得到项目信息 B2b_com_project mod = new B2b_com_projectData().GetProject(projectid, comid); if (mod != null) { projectname = mod.Projectname; projectimgurl = GetProjectImg(mod.Projectimg, mod.Id); projectbrief = mod.Briefintroduce; } B2b_company companyinfo = B2bCompanyData.GetCompany(comid); if (companyinfo.B2bcompanyinfo != null) { Wxfocus_url = companyinfo.B2bcompanyinfo.Wxfocus_url; Wxfocus_author = companyinfo.B2bcompanyinfo.Wxfocus_author; } } }
public static string posinfo(int pos_id) { var totalcount = 0; try { var projectdata = new B2b_com_projectData(); var prodata = new B2bCompanyInfoData(); var list = prodata.PosInfo(pos_id); IEnumerable result = ""; if (list != null) { result = from pro in list select new { pro.Id, pro.Com_id, pro.Posid, pro.Remark, pro.Poscompany, pro.BindingTime, Projectid = pro.Projectid, Projectname = projectdata.GetProjectname(pro.Projectid), md5key = pro.md5key } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
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); //获取微信号;使用户处于登录状态 } }
/// 抓产品 public string GetProductList(Meituan_reqlog mlog) { var response = new DealResponse(); response.partnerId = agentinfo.mt_partnerId.ConvertTo <int>(0); try { var data = JsonConvert.DeserializeObject <DealRequest>(_requestParam); if (data.body == null) { response.code = 300; response.describe = "Body数据解析失败"; } else { DealRequestBody body = data.body; //todo 根据请求参数查询产品返回结果 if (body.method.Equals("multi", StringComparison.OrdinalIgnoreCase)) { #region 获取产品列表 int totalcount = 0; List <DealResponseBody> list = new DealResponseData().GetDealResponseBody(out totalcount, agentinfo, body.method, body.partnerDealIds); foreach (DealResponseBody rbody in list) { B2b_com_project pro_project = new B2b_com_projectData().GetProject(rbody.partnerPoiId.ConvertTo <int>(0)); if (pro_project != null) { List <ServicePhone> servicePhonelist = new List <ServicePhone>(); servicePhonelist.Add(new ServicePhone { phone = pro_project.Mobile.Split(' ')[0], startHour = "08", startMin = "00", endHour = "17", endMin = "00" }); //服务电话 rbody.servicePhones = servicePhonelist; //入园地址 rbody.getInAddresses = new string[] { pro_project.Address }; } //结算价 Agent_warrant warrant = new Agent_companyData().GetAgentWarrantInfo(agentinfo.Id, rbody.partnerDealId.ConvertTo <int>(0)); if (warrant != null) { rbody.settlementPrice = new B2bComProData().GetAgentPrice(rbody.partnerDealId.ConvertTo <int>(0), warrant.Warrant_level); } /******************************* * 产品图片(最多5张)=产品主图片+产品子图片(前4张) * ******************************/ List <DealImageInfo> imgs = rbody.dealImageInfos; int topnum = 4; List <int> childimgarr = new B2bComProData().GetProChildImgArr(rbody.partnerDealId.ConvertTo <int>(0), topnum); if (childimgarr.Count > 0) { foreach (int iimg in childimgarr) { imgs.Add(new DealImageInfo { imageName = "", imageUrl = iimg.ToString(), frontImage = false }); } } foreach (DealImageInfo iinfo in imgs) { var iimgurl = FileSerivce.GetImgUrl(iinfo.imageUrl.ConvertTo <int>(0)); iinfo.imageUrl = iimgurl; } rbody.dealImageInfos = imgs; } if (list.Count > 0) { response.code = 200; response.describe = "success"; response.partnerId = int.Parse(agentinfo.mt_partnerId); response.totalSize = totalcount; response.body = list; } else { response.code = 300; response.describe = "获取deal失败"; } #endregion } else if (body.method.Equals("page", StringComparison.OrdinalIgnoreCase)) { int pageindex = body.currentPage, pagesize = body.pageSize; if (pageindex <= 0) { pageindex = 1; } if (pagesize <= 0 || pagesize > 20) { pagesize = 20; } #region 获取产品列表 int totalcount = 0; List <DealResponseBody> list = new DealResponseData().GetDealResponseBody(out totalcount, agentinfo, body.method, body.partnerDealIds, pageindex, pagesize); foreach (DealResponseBody rbody in list) { B2b_com_project pro_project = new B2b_com_projectData().GetProject(rbody.partnerPoiId.ConvertTo <int>(0)); if (pro_project != null) { List <ServicePhone> servicePhonelist = new List <ServicePhone>(); servicePhonelist.Add(new ServicePhone { phone = pro_project.Mobile.Split(' ')[0], startHour = "08", startMin = "00", endHour = "17", endMin = "00" }); //服务电话 rbody.servicePhones = servicePhonelist; //入园地址 rbody.getInAddresses = new string[] { pro_project.Address }; } //结算价 Agent_warrant warrant = new Agent_companyData().GetAgentWarrantInfo(agentinfo.Id, rbody.partnerDealId.ConvertTo <int>(0)); if (warrant != null) { rbody.settlementPrice = new B2bComProData().GetAgentPrice(rbody.partnerDealId.ConvertTo <int>(0), warrant.Warrant_level); } /******************************* * 产品图片(最多5张)=产品主图片+产品子图片(前4张) * ******************************/ List <DealImageInfo> imgs = rbody.dealImageInfos; int topnum = 4; List <int> childimgarr = new B2bComProData().GetProChildImgArr(rbody.partnerDealId.ConvertTo <int>(0), topnum); if (childimgarr.Count > 0) { foreach (int iimg in childimgarr) { imgs.Add(new DealImageInfo { imageName = "", imageUrl = iimg.ToString(), frontImage = false }); } } foreach (DealImageInfo iinfo in imgs) { var iimgurl = FileSerivce.GetImgUrl(iinfo.imageUrl.ConvertTo <int>(0)); iinfo.imageUrl = iimgurl; } rbody.dealImageInfos = imgs; } if (list.Count > 0) { response.code = 200; response.describe = "success"; response.partnerId = int.Parse(agentinfo.mt_partnerId); response.totalSize = totalcount; //response.body = new List<DealResponseBody>(); response.body = list; } else { response.code = 300; response.describe = "获取deal为空"; } #endregion } else { response.code = 300; response.describe = "拉取方式(method:" + body.method + ")出错"; } } } catch (Exception ex) { response.code = 300; response.describe = "异常错误"; } string json = JsonConvert.SerializeObject(response); #region 把处理结果录入数据库 mlog.respstr = json; mlog.resptime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); mlog.code = response.code.ToString(); mlog.describe = response.describe; new Meituan_reqlogData().EditReqlog(mlog); #endregion return(json); }
public int viewtop = 1; //头部及左侧相关显示控制 protected void Page_Load(object sender, EventArgs e) { //如果判断手机浏览器 跳转手机版 string u = Request.ServerVariables["HTTP_USER_AGENT"]; bool bo = detectmobilebrowser.HttpUserAgent(u); if (bo) { Response.Redirect("/h5/order/"); } RequestUrl = Request.ServerVariables["SERVER_NAME"].ToString(); comid = Request["comid"].ConvertTo <int>(0); menuindex = Request["menuindex"].ConvertTo <int>(0); B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl); if (companyinfo != null) { comid = companyinfo.Com_id; } else { //判定是否为自助域名规则安 shop1.etown.cn if (Domain_def.Domain_yanzheng(RequestUrl)) { comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl)); } } //绿野 不显示头部 if (comid == 2553) { viewtop = 0; } //判断商户ID(域名未绑定) if (comid != 0) { B2b_company modlecom = B2bCompanyData.GetAllComMsg(comid); if (modlecom != null) { Com_name = modlecom.Com_name; txtServiceInfo = modlecom.B2bcompanyinfo.Serviceinfo; Scenic_name = modlecom.Scenic_name; scenic_address = modlecom.B2bcompanyinfo.Scenic_address; coordinate = modlecom.B2bcompanyinfo.Coordinate; coordinatesize = modlecom.B2bcompanyinfo.Coordinatesize; weixinimg = modlecom.B2bcompanyinfo.Weixinimg; weixinname = modlecom.B2bcompanyinfo.Weixinname; Qq = modlecom.B2bcompanyinfo.Qq; } 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)); } Copyright = pro.Copyright; Tel = pro.Service_Phone; } //读取首页栏目,只读取前10个栏目,太多影响打开 var shopmenudata = new B2bCompanyMenuData(); menulist = shopmenudata.GetMenuList(comid, 1, 10, out menutotalcount, 1, menuindex); if (menulist != null) { for (int i = 0; i < menulist.Count; i++) { menulist[i].Imgurl_address = FileSerivce.GetImgUrl(menulist[i].Imgurl); } } //如果没有栏目读取项目 if (menutotalcount == 0) { var prodata = new B2b_com_projectData(); projectlist = prodata.Projectpagelist(comid.ToString(), 1, 10, "1", out porjectcount, ""); } } int totalcount = 0; if (Session["AccountId"] != null) { //账户信息 AccountId = Int32.Parse(Session["AccountId"].ToString()); AccountName = Session["AccountName"].ToString(); AccountCard = Session["AccountCard"].ToString(); RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower(); //会员信息 B2bCrmData dateuser = new B2bCrmData(); B2b_crm modeluser = dateuser.Readuser(AccountId, comid); if (modeluser != null) { AccountWeixin = modeluser.Weixin; AccountEmail = modeluser.Email; Accountphone = modeluser.Phone; Imprest = modeluser.Imprest; Integral = modeluser.Integral; //密码 AccountPass = modeluser.Password1; //微信关注 weixin = modeluser.Weixin == "" ? "未关注" : "已关注"; } //用户订单 //List<B2b_order> orderlist = new B2bOrderData().ComOrderPageList(comid,1, 100, AccountId, out totalcount); //Rporder.DataSource = orderlist; //Rporder.DataBind(); } }
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); MasterId = Request["MasterId"].ConvertTo <int>(0); //获取IP地址 uip = CommonFunc.GetRealIP(); id = Request["id"].ConvertTo <int>(0); nowdate = DateTime.Now.ToString("yyyy-MM-dd"); nowtoday = DateTime.Now; buyuid = Request["buyuid"].ConvertTo <int>(0); tocomid = Request["tocomid"].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 (id != 0) { B2b_com_pro pro = new B2bComProData().GetProById(id.ToString()); if (pro != null) { channelcoachid = new MemberChannelData().GetChannelidbymanageuserid(MasterId, pro.Com_id); if (pro.Server_type == 13) { //如果 产品为教练产品 if (channelcoachid == 0) { //当未选择教练 则 跳转到教练页面 Response.Redirect("/h5/coachList.aspx?come=" + id); } } Ispanicbuy = pro.Ispanicbuy; //是否抢购或限购 Limitbuytotalnum = pro.Limitbuytotalnum; //限购数量 bindname = pro.bookpro_bindname; bindphone = pro.bookpro_bindphone; manyspeci = pro.Manyspeci; Wrentserver = pro.Wrentserver; //如果多规格读取规格 if (manyspeci == 1) { gglist = new B2b_com_pro_SpeciData().Getgglist(pro.Id); } //对默认只显示预约电话进行 if (pro.Server_type == 12 || pro.Server_type == 13) { //当时预约产品就先设定显示预约电话 view_phone = 1; //先判断渠道来路,如果没有渠道则安默认,如果有来路渠道,则显示来路渠道 if (MasterId != 0) { B2b_company_manageuser manageruser = B2bCompanyManagerUserData.GetUser(MasterId); if (manageruser != null) { bindname = manageruser.Employeename; bindphone = manageruser.Tel; } } //判断 绑定渠道电话 与 访问来的渠道电话相同 则 显示电话,并显示预订 if (bindphone == pro.bookpro_bindphone) { view_phone = 2; } //如果为教练产品,显示订购和 和图像 不显示电话 if (pro.Server_type == 13) { view_phone = 3; } } //通过 显示渠道的电话 来查找头像 B2b_company_manageuser manageruser_temp = new B2bCompanyManagerUserData().GetCompanyUserByPhone(bindphone, pro.Com_id); if (manageruser_temp != null) { channleimg = FileSerivce.GetImgUrl(manageruser_temp.Headimg); if (channleimg == "/Images/defaultThumb.png") { channleimg = ""; } } //查询相关项目名称 var proprojectdata = new B2b_com_projectData(); var proprejectinfo = proprojectdata.GetProject(pro.Projectid, pro.Com_id); if (proprejectinfo != null) { projectname = proprejectinfo.Projectname; Coordinate = proprejectinfo.Coordinate; Address = proprejectinfo.Address; } projectname = proprojectdata.GetProjectNameByid(pro.Projectid); //根据产品判断商家是否含有自己的微信支付:a.含有的话支付到商家;b.没有的话支付到平台的微信公众号账户中 B2b_finance_paytype model = new B2b_finance_paytypeData().GetFinancePayTypeByComid(pro.Com_id); //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; } } //票务产品,判断 是否抢购/限购,是的话 作废超时未支付订单,完成回滚操作 if (pro_servertype == 1) { if (pro.Ispanicbuy == 1 || pro.Ispanicbuy == 2) { int rs = new B2bComProData().CancelOvertimeOrder(pro); } } iscanbook = new B2bComProData().IsYouxiao(pro.Id, pro.Server_type, pro.Pro_start, pro.Pro_end, pro.Pro_state);//判断产品是否有效:1.票务,直接判断有效期 和产品上线状态2.酒店,跟团游,当地游 则判断是否含有有效的房态/团期 以及产品上下线状态 pro_servertype = pro.Server_type; pickuppoint = pro.pickuppoint; dropoffpoint = pro.dropoffpoint; childreduce = pro.Childreduce; if (pro.Ispanicbuy == 1) { panic_begintime = pro.Panic_begintime; panicbuy_endtime = pro.Panicbuy_endtime; TimeSpan tss = pro.Panic_begintime - nowtoday; var day = tss.Days * 24 * 3600;; //这是相差的天数 var h = tss.Hours * 3600; //这是相差的小时数, var m = tss.Minutes * 60; var s = tss.Seconds; shijiacha = day + h + m + s; } projectid = pro.Projectid; comid = pro.Com_id; pro_name = pro.Pro_name; price = pro.Advise_price; face_price = pro.Face_price; limitbuytotalnum = pro.Limitbuytotalnum; imgurl = FileSerivce.GetImgUrl(pro.Imgurl); //如果含有规格读取规格价格中最低价 if (manyspeci == 1) { if (gglist != null) { price = 0; face_price = 0; for (int i = 0; i < gglist.Count(); i++) { if (gglist[i].speci_advise_price != 0) { if (price == 0 || price > gglist[i].speci_advise_price) { price = gglist[i].speci_advise_price; face_price = gglist[i].speci_face_price; } } } } } if (price == 0) { price = 0; } else { CommonFunc.OperTwoDecimal(price.ToString()); //price = price.IndexOf(".") != -1 ? price.Substring(0, price.IndexOf(".")) : price; } if (face_price != 0) { CommonFunc.OperTwoDecimal(face_price.ToString()); } nowdate = DateTime.Now.ToString("yyyy-MM-dd"); if (pro.Service_Contain != "") { sumaryend = pro.Service_Contain; } if (pro.Service_NotContain != "") { sumaryend = sumaryend + "</br> " + pro.Service_NotContain; } if (pro.Precautions != "") { sumaryend = sumaryend + "</br> " + pro.Precautions; } Server_type = pro.Server_type; bookpro_ispay = pro.bookpro_ispay; //如果服务类型是 票务; 则备注信息中 显示 电子码使用限制 if (pro.Server_type == 1) { if (pro.Iscanuseonsameday == 0)//电子码当天不可用 { youxianshiduan = "此产品当天预订不可用"; } if (pro.Iscanuseonsameday == 1)//电子码当天可用 { youxianshiduan = "此产品当天预订可用"; } if (pro.Iscanuseonsameday == 2)//电子码出票2小时内不可用 { youxianshiduan = "此产品出票2小时内不可用"; } } remark = pro.Pro_Remark; pro_num = pro.Pro_number; if (pro_num == 0) { pro_max = 100; pro_min = 1; } else { pro_min = 1; pro_max = pro_num; } pro_explain = pro.Pro_explain; #region 产品有效期判定(微信模板--门票订单预订成功通知 中也有用到) provalidatemethod = pro.ProValidateMethod; //判断 1按产品有效期,2指定有效期 appointdate = pro.Appointdata; //1=一星期,,2=1个月,3=3个月,4=6个月,5=一年 iscanuseonsameday = pro.Iscanuseonsameday; //1当天可用,0当天不可用 pro_end = pro.Pro_end; pro_end_str = pro.Pro_end.AddMonths(-1).ToString("yyyy,MM,dd"); //返回有效期 pro_youxiaoqi = new B2bComProData().GetPro_Youxiaoqi(pro.Pro_start, pro.Pro_end, provalidatemethod, appointdate, iscanuseonsameday); #endregion //如果是 教练产品 根据教练信息 获取教练 上班时间 if (pro.Server_type == 13 || pro.Server_type == 12) { //必须是教练产品 if (MasterId != 0) //必须有教练参数 { B2b_company_manageuser manageruser = B2bCompanyManagerUserData.GetUser(MasterId); if (manageruser != null) { if (manageruser.Workdays != "") { if (manageruser.worktimestar != 0) { if (manageruser.worktimestar < manageruser.worktimeend) { for (var i = manageruser.worktimestar; i < manageruser.worktimeend; i++) { workh += "<option value=\"" + i + "\">" + i + "点</option>"; } } else { var day1 = 24 - manageruser.worktimestar; var day2 = manageruser.worktimeend; var day3 = day1 + day2; for (var i = 0; i > day3; i++) { if (i > day1) { workh += "<option value=\"" + (manageruser.worktimestar + i) + "\">" + (manageruser.worktimestar + i) + "点</option>"; } else { workh += "<option value=\"" + (manageruser.worktimestar - i) + "\">" + (manageruser.worktimestar - i) + "点</option>"; } } } } if (!manageruser.Workdays.Contains("2")) //检验不含周一 { DateTime dt = DateTime.Now; //当前时间 DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))); //本周周一 //初始日期为今天,到产品有效期结束 增加一周(7天)方式 for (var i = startWeek; i < pro_end; i.AddDays(7)) { nowork += "[" + i.Month + "," + i.Day + "," + i.Year + "],"; i = i.AddDays(7); } } if (!manageruser.Workdays.Contains("3")) //检验不含周二 { DateTime dt = DateTime.Now; //当前时间 DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))).AddDays(1); //本周周二 //初始日期为今天,到产品有效期结束 增加一周(7天)方式 for (var i = startWeek; i < pro_end; i.AddDays(7)) { nowork += "[" + i.Month + "," + i.Day + "," + i.Year + "],"; i = i.AddDays(7); } } if (!manageruser.Workdays.Contains("4")) //检验不含周3 { DateTime dt = DateTime.Now; //当前时间 DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))).AddDays(2); //本周周3 //初始日期为今天,到产品有效期结束 增加一周(7天)方式 for (var i = startWeek; i < pro_end; i.AddDays(7)) { nowork += "[" + i.Month + "," + i.Day + "," + i.Year + "],"; i = i.AddDays(7); } } if (!manageruser.Workdays.Contains("5")) //检验不含周4 { DateTime dt = DateTime.Now; //当前时间 DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))).AddDays(3); //本周周4 //初始日期为今天,到产品有效期结束 增加一周(7天)方式 for (var i = startWeek; i < pro_end; i.AddDays(7)) { nowork += "[" + i.Month + "," + i.Day + "," + i.Year + "],"; i = i.AddDays(7); } } if (!manageruser.Workdays.Contains("6")) //检验不含周5 { DateTime dt = DateTime.Now; //当前时间 DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))).AddDays(4); //本周周5 //初始日期为今天,到产品有效期结束 增加一周(7天)方式 for (var i = startWeek; i < pro_end; i.AddDays(7)) { nowork += "[" + i.Month + "," + i.Day + "," + i.Year + "],"; i = i.AddDays(7); } } if (!manageruser.Workdays.Contains("7")) //检验不含周6 { DateTime dt = DateTime.Now; //当前时间 DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))).AddDays(5); //本周周6 //初始日期为今天,到产品有效期结束 增加一周(7天)方式 for (var i = startWeek; i < pro_end; i.AddDays(7)) { nowork += "[" + i.Month + "," + i.Day + "," + i.Year + "],"; i = i.AddDays(7); } } if (!manageruser.Workdays.Contains("1")) //检验不含周日 { DateTime dt = DateTime.Now; //当前时间 DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))).AddDays(6); //本周周日 //初始日期为今天,到产品有效期结束 增加一周(7天)方式 for (var i = startWeek; i < pro_end; i.AddDays(7)) { nowork += "[" + i.Month + "," + i.Day + "," + i.Year + "],"; i = i.AddDays(7); } } } } } } } var commodel = B2bCompanyData.GetCompany(comid); if (commodel != null) { if (commodel.B2bcompanyinfo != null) { Wxfocus_url = commodel.B2bcompanyinfo.Wxfocus_url; Wxfocus_author = commodel.B2bcompanyinfo.Wxfocus_author;; } } var saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (saleset != null) { phone = saleset.Service_Phone; } //查询项目电话,如果有项目电话调取项目电话 var projectdata = new B2b_com_projectData(); var projectmodel = projectdata.GetProject(projectid, comid); if (projectmodel != null) { if (projectmodel.Mobile != "") { phone = projectmodel.Mobile; } } //从cookie中得到微信号 if (Request.Cookies["openid"] != null) { openid = Request.Cookies["openid"].Value; } B2bCrmData b2b_crm = new B2bCrmData(); if (openid != "") { B2b_crm b2bmodle = b2b_crm.b2b_crmH5(openid, comid); if (b2bmodle != null) { Imprest = b2bmodle.Imprest; Integral = b2bmodle.Integral; } } } if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { //先通过正则表达式获取COMid comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString()); } if (comid == 0)//如果非标准格式,查询 是否有绑定的域名 { var wxdomain = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl); if (wxdomain != null) { comid = wxdomain.Comid; } } 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) { //根据公司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); } } } }
//str4=电话,str7=预订热线 protected void Page_Load(object sender, EventArgs e) { id = Request["orderid"].ConvertTo <int>(0); B2bOrderData orderdata = new B2bOrderData(); var orderinfo = orderdata.GetOrderById(id); if (orderinfo == null) { Response.Redirect("Order.aspx");//未查询到订单 return; } //订单数量 ordernum = orderinfo.U_num; subtime = orderinfo.U_subdate; B2bEticketData eticketdata = new B2bEticketData(); //已打印数量 printnum = eticketdata.AlreadyPrintNumbyOrderid(id); unprintnum = ordernum - printnum; B2bComProData prodate = new B2bComProData(); var proinfo = prodate.GetProById(orderinfo.Pro_id.ToString()); if (proinfo != null) { comid_temp = proinfo.Com_id; proname = proinfo.Pro_name; Face_price = proinfo.Face_price; pro_end = proinfo.Pro_end.ToString("yyyy年MM月dd日"); pro_start = proinfo.Pro_start.ToString("yyyy年MM月dd日"); Pro_Remark = "备注: " + proinfo.pro_note; B2b_com_projectData projectdate = new B2b_com_projectData(); var projectinfo = projectdate.GetProject(proinfo.Projectid, proinfo.Com_id); if (projectinfo != null) { address = "地址:" + projectinfo.Address; mobile = projectinfo.Mobile; //proname = projectinfo.Projectname + proname;//不增加项目信息 } if (orderinfo.Agentid != 0) { var agentinfo = AgentCompanyData.GetAgentByid(orderinfo.Agentid); if (agentinfo != null) { mobile = agentinfo.Mobile;//读取分销电话 agentcompany = agentinfo.Company; } } } B2b_company companyinfo = B2bCompanyData.GetAllComMsg(comid_temp); if (companyinfo != null) { company = companyinfo.Com_name; } if (Session["Agentid"] != null) { //账户信息 Agentid = Int32.Parse(Session["Agentid"].ToString()); Account = Session["Account"].ToString(); if (Agentid != orderinfo.Agentid) { //订单与分销不匹配 Response.Redirect("order.aspx"); } Agent_company agenginfo = AgentCompanyData.GetAgentWarrant(Agentid, comid_temp); if (agenginfo != null) { yufukuan = "您预付款:" + agenginfo.Imprest.ToString("0.00") + " 元"; Warrant_type = agenginfo.Warrant_type; if (Warrant_type == 1) { Warrant_type_str = "销售扣款"; } if (Warrant_type == 2) { Warrant_type_str = "验证扣款"; } } else { Response.Redirect("/Agent/Default.aspx"); } } }
public int promotetypeid = 0; //文章分类 protected void Page_Load(object sender, EventArgs e) { RequestUrl = Request.ServerVariables["SERVER_NAME"].ToString(); comid = Request["comid"].ConvertTo <int>(0); id = Request["id"].ConvertTo <int>(0); promotetypeid = Request["promotetypeid"].ConvertTo <int>(0); B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl); if (companyinfo != null) { comid = companyinfo.Com_id; } else { //判定是否为自助域名规则安 shop1.etown.cn if (Domain_def.Domain_yanzheng(RequestUrl)) { comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl)); } } if (comid != 0) { //从cookie中得到微信号 if (Request.Cookies["openid"] != null) { openid = Request.Cookies["openid"].Value; } B2bCrmData b2b_crm = new B2bCrmData(); if (openid != "") { B2b_crm b2bmodle = b2b_crm.b2b_crmH5(openid, comid); if (b2bmodle != null) { Imprest = b2bmodle.Imprest; Integral = b2bmodle.Integral; } } } //判断商户ID(域名未绑定) if (comid != 0) { B2b_company modlecom = B2bCompanyData.GetAllComMsg(comid); if (modlecom != null) { Com_name = modlecom.Com_name; title = modlecom.Com_name; txtServiceInfo = modlecom.B2bcompanyinfo.Serviceinfo; Scenic_name = modlecom.Scenic_name; scenic_address = modlecom.B2bcompanyinfo.Scenic_address; coordinate = modlecom.B2bcompanyinfo.Coordinate; coordinatesize = modlecom.B2bcompanyinfo.Coordinatesize; weixinimg = modlecom.B2bcompanyinfo.Weixinimg; weixinname = modlecom.B2bcompanyinfo.Weixinname; Qq = modlecom.B2bcompanyinfo.Qq; Wxfocus_url = modlecom.B2bcompanyinfo.Wxfocus_url; Wxfocus_author = modlecom.B2bcompanyinfo.Wxfocus_author;; } 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)); } phone = pro.Service_Phone; Copyright = pro.Copyright; Tel = pro.Service_Phone; } //读取首页栏目,只读取前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 (menutotalcount == 0) { var prodata = new B2b_com_projectData(); projectlist = prodata.Projectpagelist(comid.ToString(), 1, 10, "1", out porjectcount, ""); } } int totalcount = 0; if (Session["AccountId"] != null) { //账户信息 AccountId = Int32.Parse(Session["AccountId"].ToString()); AccountName = Session["AccountName"].ToString(); AccountCard = Session["AccountCard"].ToString(); RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower(); } }
public bool iswxsubscribenum = false; //是否是微信认证订阅号/订阅号 protected void Page_Load(object sender, EventArgs e) { string u = Request.ServerVariables["HTTP_USER_AGENT"]; bo = detectmobilebrowser.HttpUserAgent(u); proclass = Request["proclass"].ConvertTo <int>(0); projectid = Request["projectid"].ConvertTo <int>(0); //string u = Request.ServerVariables["HTTP_USER_AGENT"]; //bool bo = detectmobilebrowser.HttpUserAgent(u); id = Request["id"].ConvertTo <int>(0); num = Request["num"].ConvertTo <int>(1); nowdate = DateTime.Now.ToString("yyyy-MM-dd"); nowtoday = DateTime.Now; buyuid = Request["buyuid"].ConvertTo <int>(0); tocomid = Request["tocomid"].ConvertTo <int>(0); pno = Request["pno"].ConvertTo <string>(""); if (id != 0) { B2b_com_pro pro = new B2bComProData().GetProById(id.ToString()); if (pro != null) { isSetVisitDate = pro.isSetVisitDate; // 作废超时未支付订单,完成回滚操作 int rs = new B2bComProData().CancelOvertimeOrder(pro); if (pro.Source_type == 4) { iscanbook = 1; } else { iscanbook = new B2bComProData().IsYouxiao(pro.Id, pro.Server_type, pro.Pro_start, pro.Pro_end, pro.Pro_state);//判断产品是否有效:1.票务,直接判断有效期 和产品上线状态2.酒店,跟团游,当地游 则判断是否含有有效的房态/团期 以及产品上下线状态 } //判断微信 是否是认证服务号 WeiXinBasic mbasic = new WeiXinBasicData().GetWxBasicByComId(pro.Com_id); if (mbasic == null) { iswxsubscribenum = false; } else { if (mbasic.Weixintype == 1 || mbasic.Weixintype == 2) { iswxsubscribenum = true; } else { iswxsubscribenum = false; } } pro_servertype = pro.Server_type; pickuppoint = pro.pickuppoint; dropoffpoint = pro.dropoffpoint; childreduce = pro.Childreduce; imgurl = FileSerivce.GetImgUrl(pro.Imgurl); //实物产品必须进入 新商城页面订购 if (pro.Server_type == 11) { Response.Redirect("/h5/order/pro.aspx?id=" + id); } face_price = pro.Face_price; manyspeci = pro.Manyspeci; //如果多规格读取规格 if (manyspeci == 1) { gglist = new B2b_com_pro_SpeciData().Getgglist(pro.Id); } } if (pro.Ispanicbuy == 1) { panic_begintime = pro.Panic_begintime; panicbuy_endtime = pro.Panicbuy_endtime; TimeSpan tss = pro.Panic_begintime - nowtoday; var day = tss.Days * 24 * 3600;; //这是相差的天数 var h = tss.Hours * 3600; //这是相差的小时数, var m = tss.Minutes * 60; var s = tss.Seconds; shijiacha = day + h + m + s; } projectid = pro.Projectid; comid = pro.Com_id; pro_name = pro.Pro_name; price = pro.Advise_price.ToString(); if (price == "0.00" || price == "0") { price = "0"; } else { CommonFunc.OperTwoDecimal(price); //price = price.IndexOf(".") != -1 ? price.Substring(0, price.IndexOf(".")) : price; } nowdate = DateTime.Now.ToString("yyyy-MM-dd"); summary = "包含服务:" + pro.Service_Contain; sumaryend = summary; if (pro.Service_NotContain != "") { sumaryend += "</br> 不包含服务:" + pro.Service_NotContain + "</br>"; } if (pro.Precautions != "") { sumaryend += "注意事项:" + pro.Precautions; } //如果服务类型是 票务; 则备注信息中 显示 电子码使用限制 if (pro.Server_type == 1) { if (pro.Iscanuseonsameday == 0)//电子码当天不可用 { sumaryend = "此产品当天预订不可用<br>" + sumaryend; } if (pro.Iscanuseonsameday == 1)//电子码当天可用 { sumaryend = "此产品当天预订可用<br>" + sumaryend; } if (pro.Iscanuseonsameday == 2)//电子码出票2小时内不可用 { sumaryend = "此产品出票2小时内不可用<br>" + sumaryend; } } if (summary.Length > 30) { summary = summary.Substring(0, 30); } if (summary.Length > 150) { summary = summary.Substring(0, 150) + "..."; } remark = pro.Pro_Remark; pro_num = pro.Pro_number; if (pro_num == 0) { pro_max = 100; pro_min = 1; } else { pro_min = 1; pro_max = pro_num; } if (pno != "") { pro_max = 1; string pno1 = EncryptionHelper.EticketPnoDES(pno, 1);//解密 var prodata = new B2bEticketData(); var eticketinfo = prodata.GetEticketDetail(pno1); if (eticketinfo != null) { Use_pnum = eticketinfo.Use_pnum;//重新设定最大数 不能大于可以预定数量 bindingname = eticketinfo.bindingname; bindingphone = eticketinfo.bindingphone; bindingcard = eticketinfo.bindingcard; } //查询绑定状态 var busbindingdata = new Bus_FeeticketData(); var busbindinginfo = busbindingdata.Bus_Feeticket_proById(0, 0, id, pno1); if (busbindinginfo != null) { limitweek = busbindinginfo.limitweek; limitweekdaynum = busbindinginfo.limitweekdaynum; limitweekendnum = busbindinginfo.limitweekendnum; if (busbindinginfo.Busid != 0) { var busfeetticketinfo = busbindingdata.GetBus_FeeticketById(busbindinginfo.Busid, eticketinfo.Com_id); if (busfeetticketinfo != null) { Iuse = busfeetticketinfo.Iuse; } } } //如果不是限制个人使用 则 最大限购数不为 电子票剩余使用量 if (Iuse == 0) { pro_max = Use_pnum; } } if (pro.Server_type == 1) { pro_explain = pro.Pro_explain; } #region 产品有效期判定(微信模板--门票订单预订成功通知 中也有用到) provalidatemethod = pro.ProValidateMethod; //判断 1按产品有效期,2指定有效期 appointdate = pro.Appointdata; //1=一星期,,2=1个月,3=3个月,4=6个月,5=一年 iscanuseonsameday = pro.Iscanuseonsameday; //1当天可用,0当天不可用 DateTime pro_end = pro.Pro_end; //返回有效期 pro_youxiaoqi = new B2bComProData().GetPro_Youxiaoqi(pro.Pro_start, pro.Pro_end, provalidatemethod, appointdate, iscanuseonsameday); #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; } title = commodel.Com_name; } B2b_company_saleset procom = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (procom != null) { comlogo = FileSerivce.GetImgUrl(procom.Smalllogo.ConvertTo <int>(0)); logoimg = comlogo; } var saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (saleset != null) { phone = saleset.Service_Phone; } //查询项目电话,如果有项目电话调取项目电话 var projectdata = new B2b_com_projectData(); var projectmodel = projectdata.GetProject(projectid, comid); if (projectmodel != null) { if (projectmodel.Mobile != "") { phone = projectmodel.Mobile; } } //从cookie中得到微信号 if (Request.Cookies["openid"] != null) { openid = Request.Cookies["openid"].Value; } B2bCrmData b2b_crm = new B2bCrmData(); if (openid != "") { B2b_crm b2bmodle = b2b_crm.b2b_crmH5(openid, comid); if (b2bmodle != null) { Imprest = b2bmodle.Imprest; Integral = b2bmodle.Integral; } } } }
public void Page_Load(object sender, EventArgs e) { string u = Request.ServerVariables["HTTP_USER_AGENT"]; bo = detectmobilebrowser.HttpUserAgent(u); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "Request.Url:" + Request.Url.ToString()); id = Request["id"].ConvertTo <string>(""); string temp_id = Request["id"].ConvertTo <string>(""); 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); } //取消超时订单 B2b_com_pro pro_cannelorder = new B2b_com_pro(); pro_cannelorder.Server_type = 0; int rs_cannelorder = new B2bComProData().CancelOvertimeOrder(pro_cannelorder); num = Request["num"].ConvertTo <int>(1); string aRequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower(); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "aRequestUrl:" + aRequestUrl); if (Domain_def.Domain_yanzheng(aRequestUrl))//如果符合shop101.etown.cn的格式 { //先通过正则表达式获取COMid comid = Int32.Parse(Domain_def.Domain_Huoqu(aRequestUrl).ToString()); } if (comid == 0)//如果非标准格式,查询 是否有绑定的域名 { var domaincomid = B2bCompanyData.GetComId(RequestUrl); if (domaincomid != null) { comid = domaincomid.Com_id; } } //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "comid:" + comid); #region 判断是否含有微信端传递过来的code值,不含有自刷新 code = Request.QueryString["code"].ConvertTo <string>(""); if (code == "") { selfrefreshurl = WeiXinJsonData.GetFollowOpenLinkUrlAboutPay(comid, "http://shop" + comid + ".etown.cn/wxpay/micromart_pay_" + num + "_" + id + ".aspx"); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "selfrefreshurl:" + selfrefreshurl); //Response.Redirect(refreshurl); } #endregion //buyuid = Request["buyuid"].ConvertTo<int>(0); //tocomid = Request["tocomid"].ConvertTo<int>(0); //uid = Request["uid"].ConvertTo<int>(0); //获取IP地址 uip = CommonFunc.GetRealIP(); nowdate = DateTime.Now.ToString("yyyy-MM-dd"); nowtoday = DateTime.Now; if (temp_id != "") { B2bOrderData orderdata = new B2bOrderData(); var pro = orderdata.GetOrderById(int.Parse(temp_id)); if (pro != null) { orderstatus = EnumUtils.GetName((OrderStatus)pro.Order_state); order_state = pro.Order_state; subtime = pro.U_subdate.ToString("yyyy/MM/dd hh:mm:ss"); paystate = pro.Pay_state; #region 微信端 共享收货地址接口 参数获取 //根据产品判断商家是否含有自己的微信支付:a.含有的话支付到商家;b.没有的话支付到平台的微信公众号账户中 B2b_finance_paytype model = new B2b_finance_paytypeData().GetFinancePayTypeByComid(pro.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; if (code != "") { string url = string.Format( "https://api.weixin.qq.com/sns/oauth2/access_token?appid={0}&secret={1}&code={2}&grant_type=authorization_code", appId, appsecret, code); string returnStr = HttpUtil.Send("", url); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "returnStr:" + returnStr); var obj = JsonConvert.DeserializeObject <ModelOpenID>(returnStr); if (obj.openid == null) { //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "微信转发页面打开的,returnStr:" + returnStr); selfrefreshurl = WeiXinJsonData.GetFollowOpenLinkUrlAboutPay(comid, "http://shop" + comid + ".etown.cn/wxpay/micromart_pay_" + num + "_" + id + ".aspx"); Response.Redirect(selfrefreshurl); } if (obj != null) { timeStamp = TenpayUtil.getTimestamp(); nonceStr = TenpayUtil.getNoncestr(); access_tokenstring = obj.access_token; openid = obj.openid; HttpCookie newCookie = new HttpCookie("openid"); //往Cookie里面添加值,均为键/值对。Cookie可以根据关键字寻找到相应的值 newCookie.Values.Add("openid", openid); newCookie.Expires = DateTime.Now.AddDays(365); //Cookie的设置页面要用Response Response.AppendCookie(newCookie); //签名字段:appId、url(当前网页url)、timestamp、noncestr、accessToken var paySignReqHandler = new RequestHandler(Context); paySignReqHandler.setParameter("appid", appId); paySignReqHandler.setParameter("timestamp", timeStamp); paySignReqHandler.setParameter("noncestr", nonceStr); paySignReqHandler.setParameter("url", Request.Url.ToString()); paySignReqHandler.setParameter("accesstoken", obj.access_token); //addrSign = paySignReqHandler.CreateAddrSign(); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", appId + ";" + timeStamp + ";" + nonceStr + ";" + Request.Url.ToString() + ";" + obj.access_token + ";" + addrSign); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "Request.Url:" + Request.Url.ToString()); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "addrSign:" + addrSign); } } } } #endregion address = pro.U_name + " " + pro.U_phone + "<br>" + pro.Province + " " + pro.City + " " + pro.Address; if (pro.Shopcartid == 0) { B2b_com_pro proinfo = new B2bComProData().GetProById(pro.Pro_id.ToString(), pro.Speciid, pro.channelcoachid); if (proinfo != null) { pro_name = proinfo.Pro_name; imgurl = FileSerivce.GetImgUrl(proinfo.Imgurl); Ispanicbuy = proinfo.Ispanicbuy; Server_type = proinfo.Server_type; } else { pro_name = "对订单进行支付"; } pay_price = Math.Round(pro.Pay_price, 2); pro_price = Math.Round(pro.Pay_price * pro.U_num, 2); price = Math.Round(pro.Pay_price * pro.U_num - pro.Integral1 - pro.Imprest1 + pro.Express, 2); num = pro.U_num; Express = Math.Round(pro.Express, 2); } else { //如果是购物车订单,必须一起支付 cart_id = pro.Shopcartid; cart = 1; price = Math.Round(orderdata.GetCartOrderMoneyById(pro.Id), 2); pro_name = orderdata.GetCartOrderProById(pro.Id); Express = Math.Round(orderdata.GetCartOrderExpressMoneyById(pro.Id), 2); num = 1; var shopcart = orderdata.shopcartorder(pro.Shopcartid); if (shopcart != null) { for (int i = 0; i < shopcart.Count; i++) { pro_price += shopcart[i].Pay_price * shopcart[i].U_num; proid += shopcart[i].Pro_id + ","; } } pro_price = Math.Round(pro_price, 2); } } if (price == 0) { price = 0; } else { CommonFunc.OperTwoDecimal(price.ToString()); //price = price.IndexOf(".") != -1 ? price.Substring(0, price.IndexOf(".")) : price; } nowdate = DateTime.Now.ToString("yyyy-MM-dd"); if (summary.Length > 30) { summary = summary.Substring(0, 30); } if (summary.Length > 150) { summary = summary.Substring(0, 150) + "..."; } var commodel = B2bCompanyData.GetCompany(comid); if (commodel != null) { if (commodel.B2bcompanyinfo != null) { Wxfocus_url = commodel.B2bcompanyinfo.Wxfocus_url; Wxfocus_author = commodel.B2bcompanyinfo.Wxfocus_author;; } } var saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (saleset != null) { phone = saleset.Service_Phone; } //查询项目电话,如果有项目电话调取项目电话 var projectdata = new B2b_com_projectData(); var projectmodel = projectdata.GetProject(projectid, comid); if (projectmodel != null) { if (projectmodel.Mobile != "") { phone = projectmodel.Mobile; } } //从cookie中得到微信号 if (Request.Cookies["openid"] != null) { openid = Request.Cookies["openid"].Value; } B2bCrmData b2b_crm = new B2bCrmData(); if (openid != "") { B2b_crm b2bmodle = b2b_crm.b2b_crmH5(openid, comid); if (b2bmodle != null) { Imprest = b2bmodle.Imprest; Integral = b2bmodle.Integral; } } } if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { //先通过正则表达式获取COMid comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString()); if (comid == 0) { comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid; } 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) { 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); } } } }
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; Num = orderinfo.U_num; phone = orderinfo.U_phone; Order_state = orderinfo.Order_state; Pay_state = orderinfo.Pay_state; //判断登陆状态 //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(), orderinfo.Speciid, orderinfo.channelcoachid); if (proinfo != null) { Pro_name = proinfo.Pro_name; string projectname = new B2b_com_projectData().GetProjectNameByid(proinfo.Projectid); Pro_name = projectname + Pro_name; qrmoble = proinfo.bookpro_bindphone; Server_type = proinfo.Server_type; var channelcoachid = orderinfo.channelcoachid; //如果是订房的 if (Server_type == 9) { servertitle = "订房确认"; var Hoteldata = new B2b_order_hotelData().GetHotelOrderByOrderId(id); if (Hoteldata != null) { yuyuetime = Hoteldata.Start_date.ToString("yyyy-MM-dd hh:mm") + " 离店:" + Hoteldata.End_date.ToString("yyyy-MM-dd"); } } if (Server_type == 13) { servertitle = "预约教练确认"; } var channeldata = new MemberChannelData(); var channelinfo = channeldata.GetChannelDetail(orderinfo.channelcoachid); if (channelinfo != null) { bindiname = channelinfo.Name; bindphone = channelinfo.Mobile; } var managedata = new B2bCompanyManagerUserData(); var manageinfo = managedata.GetCompanyUserByPhone(bindphone, proinfo.Com_id); if (manageinfo != null) { bindimg = FileSerivce.GetImgUrl(manageinfo.Headimg); } } } else { Response.Redirect("http://shop" + orderinfo.Comid + ".etown.cn/h5/order"); } //} } 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) { string u = Request.ServerVariables["HTTP_USER_AGENT"]; bool bo = detectmobilebrowser.HttpUserAgent(u); //返回订单号 orderid = Request["orderid"].ConvertTo <int>(0); agentorderid = Request["agentorderid"].ConvertTo <int>(0); if (orderid != 0) { //根据订单id得到订单信息 B2bOrderData dataorder = new B2bOrderData(); B2b_order modelb2border = dataorder.GetOrderById(orderid); if (modelb2border != null) { if (!bo) { Response.Redirect("/ui/vasui/pay.aspx?orderid=" + orderid + "&comid=" + modelb2border.Comid); } } //取消超时订单 B2b_com_pro pro_cannelorder = new B2b_com_pro(); pro_cannelorder.Server_type = 0; int rs_cannelorder = new B2bComProData().CancelOvertimeOrder(pro_cannelorder); orderstatus = EnumUtils.GetName((OrderStatus)modelb2border.Order_state); order_state = modelb2border.Order_state; paystatus = modelb2border.Pay_state;//1未支付;2已支付 order_type = modelb2border.Order_type; subtime = modelb2border.U_subdate.ToString("yyyy/MM/dd hh:mm:ss"); comid = modelb2border.Comid; #region 正常订单 if (modelb2border.Order_type == 1) { //根据产品id得到产品信息 B2bComProData datapro = new B2bComProData(); B2b_com_pro modelcompro = datapro.GetProById(modelb2border.Pro_id.ToString(), modelb2border.Speciid); ////如果订单“未付款”显示支付及订单信息 //if ((int)modelb2border.Order_state == (int)OrderStatus.WaitPay) //{ if (modelb2border.U_name != "") { u_name = modelb2border.U_name.Substring(0, 1) + "**"; } else { u_name = "**"; } if (modelb2border.U_phone != "") { u_mobile = modelb2border.U_phone.Substring(0, 4) + "****" + modelb2border.U_phone.Substring(modelb2border.U_phone.Length - 3, 3); } else { u_mobile = "****"; } travel_date = modelb2border.U_traveldate.ToString(); buy_num = modelb2border.U_num; if (modelcompro != null) { u_youxiaoqi = modelcompro.Pro_start.ToString() + " - " + modelcompro.Pro_end.ToString(); travel_proid = modelcompro.Travelproductid; comid = modelcompro.Com_id; proname = modelcompro.Pro_name; servertype = modelcompro.Server_type; Ispanicbuy = modelcompro.Ispanicbuy; } #region 如果服务类型是“酒店客房”,则根据酒店扩展订单表中房态信息,获取支付金额 if (modelcompro.Server_type == 9) { B2b_order_hotel hotelorder = new B2b_order_hotelData().GetHotelOrderByOrderId(orderid); if (hotelorder != null) { string fangtai = hotelorder.Fangtai; DateTime start_data = hotelorder.Start_date; DateTime end_data = hotelorder.End_date; int bookdaynum = hotelorder.Bookdaynum; decimal everyroomprice = 0; string[] ftstr = fangtai.Split(','); for (int i = 0; i < ftstr.Length; i++) { if (ftstr[i].ConvertTo <decimal>(0) > 0) { everyroomprice += ftstr[i].ConvertTo <decimal>(0); } } price = everyroomprice.ToString(); p_totalprice = (modelb2border.U_num * everyroomprice - modelb2border.Integral1 - modelb2border.Imprest1); } } #endregion #region 当地游;跟团游;旅游大巴,获取支付金额 else if (servertype == 2 || servertype == 8) //当地游;跟团游;旅游大巴 { string outdate = modelb2border.U_traveldate.ToString("yyyy-MM-dd"); //读取団期价格,根据实际选择的団期报价 B2b_com_LineGroupDate linemode = new B2b_com_LineGroupDateData().GetLineDayGroupDate(DateTime.Parse(outdate), modelcompro.Id); if (linemode != null)//当地游;跟团游 { price = linemode.Menprice.ToString(); if (servertype == 2 || servertype == 8) { decimal childreduce = modelcompro.Childreduce; decimal childprice = decimal.Parse(price) - childreduce; if (childprice < 0) { childprice = 0; } pricedetail = modelb2border.U_num + "成人," + modelb2border.Child_u_num + "儿童(成人" + price + "元/人,儿童" + childprice + "元/人)"; p_totalprice = (modelb2border.U_num * (linemode.Menprice) + (modelb2border.Child_u_num) * childprice - modelb2border.Integral1 - modelb2border.Imprest1); } else //旅游大巴:没有儿童减免 { pricedetail = modelb2border.U_num + "人(" + price + "元/人)"; p_totalprice = (modelb2border.U_num * (linemode.Menprice) - modelb2border.Integral1 - modelb2border.Imprest1); } } } else if (servertype == 10) { pricedetail = modelb2border.U_num + "人(" + modelb2border.Pay_price.ToString("0.00") + "元/人)"; p_totalprice = (modelb2border.U_num * (modelb2border.Pay_price) - modelb2border.Integral1 - modelb2border.Imprest1); } #endregion #region 票务、实物,获取支付金额 else //票务 { p_totalprice = (modelb2border.U_num * modelb2border.Pay_price - modelb2border.Integral1 - modelb2border.Imprest1); price = modelb2border.Pay_price.ToString(); //modelb2border.Pay_price.ToString(); if (price == "0.00" || price == "0") { price = ""; } else { price = CommonFunc.OperTwoDecimal(price); } } #endregion //} #region 获得服务电话 var saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (saleset != null) { phone = saleset.Service_Phone; } if (modelcompro != null) { //查询项目电话,如果有项目电话调取项目电话 var projectdata = new B2b_com_projectData(); var projectmodel = projectdata.GetProject(modelcompro.Projectid, comid); if (projectmodel != null) { if (projectmodel.Mobile != "") { phone = projectmodel.Mobile; } } } #endregion } #endregion #region 充值订单 if (modelb2border.Order_type == 2) { if (modelb2border.serverid != "") { proname = "购买服务与押金"; } else if (modelb2border.payorder == 1) { proname = "快速支付"; } else { proname = "预付款充值"; } //ordertype=2 充值订单会传递过来值 if (comid == 0) { comid = Request["comid"].ConvertTo <int>(0); } p_totalprice = (modelb2border.U_num * modelb2border.Pay_price); //获得商户电话 var saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (saleset != null) { phone = saleset.Service_Phone; } } #endregion p_totalpricedesc = CommonFunc.OperTwoDecimal(p_totalprice.ToString()); #region 统一获得商户名称 和 微信支付链接 if (comid != 0) { wxpaylinkurl = WeiXinJsonData.GetFollowOpenLinkUrlAboutPay(comid, "http://shop" + comid + ".etown.cn/wxpay/payment_" + orderid + "_1.aspx"); comName = B2bCompanyData.GetCompany(comid).Com_name; } #endregion } }
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); 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) { comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid; } 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;; } 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); //如果是一个项目进行跳转 int totalcount = 0; var list = new B2b_com_projectData().ProjectSelectpagelist(1, 1, 10, "", out totalcount, 0, comid.ToString(), 0); if (totalcount == 1 && list != null) { Response.Redirect("Orderlist.aspx?id=" + list[0].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); } } } }
public string projectimgurl = ""; //项目图片 protected void Page_Load(object sender, EventArgs e) { DateTime checkindate1 = Request["indate"].ConvertTo <DateTime>(); checkindate = checkindate1.ToString("yyyy-MM-dd"); DateTime checkoutdate1 = Request["outdate"].ConvertTo <DateTime>(); checkoutdate = checkoutdate1.ToString("yyyy-MM-dd"); bookdaynum = (checkoutdate1 - checkindate1).Days; buyuid = Request["buyuid"].ConvertTo <int>(0); tocomid = Request["tocomid"].ConvertTo <int>(0); proid = Request["id"].ConvertTo <int>(0); comid = Request["comid"].ConvertTo <int>(0); bookdaynum = (checkoutdate1 - checkindate1).Days; uid = Request["uid"].ConvertTo <int>(0); //获得房态信息 List <B2b_com_LineGroupDate> list = new B2b_com_LineGroupDateData().GetLineDayGroupDate(checkindate, checkoutdate, proid); if (list.Count > 0) { foreach (B2b_com_LineGroupDate m in list) { singleroom_totalprice += m.Menprice; fangtai += m.Menprice + ","; } if (fangtai.Length > 0) { fangtai = fangtai.Substring(0, fangtai.Length - 1); } } if (proid != 0) { var prodata = new B2bComProData().GetProById(proid.ToString()); if (prodata != null) { comid = prodata.Com_id; B2b_com_project mod = new B2b_com_projectData().GetProject(prodata.Projectid, comid); if (mod != null) { projectimgurl = FileSerivce.GetImgUrl(mod.Projectimg); projectname = mod.Projectname; } } } //从cookie中得到微信号 if (Request.Cookies["openid"] != null) { openid = Request.Cookies["openid"].Value; } B2bCrmData b2b_crm = new B2bCrmData(); if (openid != "") { B2b_crm b2bmodle = b2b_crm.b2b_crmH5(openid, comid); if (b2bmodle != null) { Imprest = b2bmodle.Imprest; Integral = b2bmodle.Integral; } } }
public int isSetVisitDate = 0; //是否指定日期使用 public void Page_Load(object sender, EventArgs e) { string u = Request.ServerVariables["HTTP_USER_AGENT"]; bo = detectmobilebrowser.HttpUserAgent(u); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "Request.Url:" + Request.Url.ToString()); id = Request["id"].ConvertTo <string>(""); string temp_id = Request["id"].ConvertTo <string>(""); string temp_id_speciid = "0"; if (id.Contains("_"))//检验是否为购物车订单 { cart = 1; var id_arr = id.Replace('_', ','); //如果包含规格产品 var prospeciid = new B2bOrderData().SearchCartListBycartid(id_arr); if (prospeciid != null) { if (prospeciid.Count == 0) { //没有此购物车,跳转购物车重新选择产品 Response.Redirect("/h5/order/cart.aspx"); } id = ""; for (int i = 0; i < prospeciid.Count; i++) { id += prospeciid[i].Id + ","; id_speciid += prospeciid[i].Speciid + ","; temp_id = prospeciid[i].Id.ToString(); pro_id = temp_id; temp_id_speciid = prospeciid[i].Speciid.ToString(); } } else { //没有此购物车,跳转购物车重新选择产品 Response.Redirect("/h5/order/cart.aspx"); } } else { if (id.Contains("g"))//检验是否带规格 { var id_arr = id.Split('g'); id = id_arr[0]; //只针对直销单产品顶哦故 if (id_arr[1].Contains("s")) { var ids_arr = id_arr[1].Split('s'); id_speciid = ids_arr[0]; temp_id_speciid = ids_arr[0]; serverid = ids_arr[1]; serverid = serverid.Replace("A", ","); } else { id_speciid = id_arr[1]; temp_id_speciid = id_arr[1]; } temp_id = id_arr[0]; pro_id = id_arr[0]; } } //对规格默认赋值为0 if (temp_id_speciid == "") { temp_id_speciid = "0"; } 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); } num = Request["num"].ConvertTo <int>(1); string aRequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower(); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "aRequestUrl:" + aRequestUrl); if (Domain_def.Domain_yanzheng(aRequestUrl))//如果符合shop101.etown.cn的格式 { //先通过正则表达式获取COMid comid = Int32.Parse(Domain_def.Domain_Huoqu(aRequestUrl).ToString()); } if (comid == 0)//如果非标准格式,查询 是否有绑定的域名 { var domaincomid = B2bCompanyData.GetComId(RequestUrl); if (domaincomid != null) { comid = domaincomid.Com_id; } } //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "comid:" + comid); #region 判断是否含有微信端传递过来的code值,不含有自刷新 code = Request.QueryString["code"].ConvertTo <string>(""); if (code == "") { selfrefreshurl = WeiXinJsonData.GetFollowOpenLinkUrlAboutPay(comid, "http://shop" + comid + ".etown.cn/wxpay/micromart_pay_" + num + "_" + id + ".aspx"); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "selfrefreshurl:" + selfrefreshurl); //Response.Redirect(refreshurl); } #endregion //buyuid = Request["buyuid"].ConvertTo<int>(0); //tocomid = Request["tocomid"].ConvertTo<int>(0); //uid = Request["uid"].ConvertTo<int>(0); //获取IP地址 uip = CommonFunc.GetRealIP(); nowdate = DateTime.Now.ToString("yyyy-MM-dd"); nowtoday = DateTime.Now; if (temp_id != "") { //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "a"); B2b_com_pro pro = new B2bComProData().GetProById(temp_id); if (pro == null) { //没有查询到产品,跳转购物车重新选择产品 Response.Redirect("/h5/order/cart.aspx"); } if (pro != null) { //判断微信 是否是认证服务号 WeiXinBasic mbasic = new WeiXinBasicData().GetWxBasicByComId(pro.Com_id); if (mbasic == null) { iswxsubscribenum = false; } else { if (mbasic.Weixintype == 1 || mbasic.Weixintype == 2) { iswxsubscribenum = true; } else { iswxsubscribenum = false; } } #region 微信端 共享收货地址接口 参数获取 //根据产品判断商家是否含有自己的微信支付:a.含有的话支付到商家;b.没有的话支付到平台的微信公众号账户中 B2b_finance_paytype model = new B2b_finance_paytypeData().GetFinancePayTypeByComid(pro.Com_id); //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; if (code != "") { string url = string.Format( "https://api.weixin.qq.com/sns/oauth2/access_token?appid={0}&secret={1}&code={2}&grant_type=authorization_code", appId, appsecret, code); string returnStr = HttpUtil.Send("", url); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "returnStr:" + returnStr); var obj = JsonConvert.DeserializeObject <ModelOpenID>(returnStr); if (obj.openid == null) { //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "微信转发页面打开的,returnStr:" + returnStr); selfrefreshurl = WeiXinJsonData.GetFollowOpenLinkUrlAboutPay(comid, "http://shop" + comid + ".etown.cn/wxpay/micromart_pay_" + num + "_" + id + ".aspx"); Response.Redirect(selfrefreshurl); } if (obj != null) { timeStamp = TenpayUtil.getTimestamp(); nonceStr = TenpayUtil.getNoncestr(); access_tokenstring = obj.access_token; openid = obj.openid; HttpCookie newCookie = new HttpCookie("openid"); //往Cookie里面添加值,均为键/值对。Cookie可以根据关键字寻找到相应的值 newCookie.Values.Add("openid", openid); newCookie.Expires = DateTime.Now.AddDays(365); //Cookie的设置页面要用Response Response.AppendCookie(newCookie); //签名字段:appId、url(当前网页url)、timestamp、noncestr、accessToken var paySignReqHandler = new RequestHandler(Context); paySignReqHandler.setParameter("appid", appId); paySignReqHandler.setParameter("timestamp", timeStamp); paySignReqHandler.setParameter("noncestr", nonceStr); paySignReqHandler.setParameter("url", Request.Url.ToString()); paySignReqHandler.setParameter("accesstoken", obj.access_token); //addrSign = paySignReqHandler.CreateAddrSign(); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", appId + ";" + timeStamp + ";" + nonceStr + ";" + Request.Url.ToString() + ";" + obj.access_token + ";" + addrSign); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "Request.Url:" + Request.Url.ToString()); //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "addrSign:" + addrSign); } } } } #endregion //票务产品,判断 是否抢购/限购,是的话 作废超时未支付订单,完成回滚操作 if (pro_servertype == 1) { if (pro.Ispanicbuy == 1 || pro.Ispanicbuy == 2) { int rs = new B2bComProData().CancelOvertimeOrder(pro); } } iscanbook = new B2bComProData().IsYouxiao(pro.Id, pro.Server_type, pro.Pro_start, pro.Pro_end, pro.Pro_state);//判断产品是否有效:1.票务,直接判断有效期 和产品上线状态2.酒店,跟团游,当地游 则判断是否含有有效的房态/团期 以及产品上下线状态 pro_servertype = pro.Server_type; pickuppoint = pro.pickuppoint; dropoffpoint = pro.dropoffpoint; issetidcard = pro.issetidcard; isSetVisitDate = pro.isSetVisitDate; childreduce = pro.Childreduce; pro_start = pro.Pro_start; pro_end = pro.Pro_end; } if (pro.Ispanicbuy == 1) { panic_begintime = pro.Panic_begintime; panicbuy_endtime = pro.Panicbuy_endtime; TimeSpan tss = pro.Panic_begintime - nowtoday; var day = tss.Days * 24 * 3600;; //这是相差的天数 var h = tss.Hours * 3600; //这是相差的小时数, var m = tss.Minutes * 60; var s = tss.Seconds; shijiacha = day + h + m + s; } projectid = pro.Projectid; comid = pro.Com_id; if (temp_id_speciid != "0") //如果规格非默认值,有规格传递,查询规格的价格 及名称 { //如果含有规格 B2b_com_pro prospeciid = new B2bComProData().GetProspeciidById(temp_id, int.Parse(temp_id_speciid)); if (prospeciid != null) { pro_name = pro.Pro_name + prospeciid.Pro_name; price = prospeciid.Advise_price; } } else { pro_name = pro.Pro_name; price = pro.Advise_price; } //如果有服务,增加服务价格 if (serverid != "") { var server_arr = serverid.Split(','); for (int i = 0; i < server_arr.Length; i++) { if (server_arr[i] != "") { var rentsrever = new RentserverData().Rentserverbyidandproid(int.Parse(server_arr[i]), int.Parse(temp_id)); if (rentsrever != null) { price += rentsrever.saleprice + rentsrever.serverDepositprice; } } } } imgurl = FileSerivce.GetImgUrl(pro.Imgurl); if (price == 0) { price = 0; } else { CommonFunc.OperTwoDecimal(price.ToString()); //price = price.IndexOf(".") != -1 ? price.Substring(0, price.IndexOf(".")) : price; } nowdate = DateTime.Now.ToString("yyyy-MM-dd"); if (pro.Service_Contain != "") { summary = "包含服务:" + pro.Service_Contain; } if (pro.Service_NotContain != "") { sumaryend = summary + "</br> 不包含服务:" + pro.Service_NotContain + "</br> 注意事项:" + pro.Precautions; } if (pro.Precautions != "") { sumaryend = summary + "</br> 注意事项:" + pro.Precautions; } //如果服务类型是 票务; 则备注信息中 显示 电子码使用限制 if (pro.Server_type == 1) { if (pro.Iscanuseonsameday == 0)//电子码当天不可用 { sumaryend = "此产品当天预订不可用<br>" + sumaryend; } if (pro.Iscanuseonsameday == 1)//电子码当天可用 { sumaryend = "此产品当天预订可用<br>" + sumaryend; } if (pro.Iscanuseonsameday == 2)//电子码出票2小时内不可用 { sumaryend = "此产品出票2小时内不可用<br>" + sumaryend; } } if (summary.Length > 30) { summary = summary.Substring(0, 30); } if (summary.Length > 150) { summary = summary.Substring(0, 150) + "..."; } remark = pro.Pro_Remark; pro_num = pro.Pro_number; if (pro_num == 0) { pro_max = 100; pro_min = 1; } else { pro_min = 1; pro_max = pro_num; } pro_explain = pro.Pro_explain; #region 产品有效期判定(微信模板--门票订单预订成功通知 中也有用到) provalidatemethod = pro.ProValidateMethod; //判断 1按产品有效期,2指定有效期 appointdate = pro.Appointdata; //1=一星期,,2=1个月,3=3个月,4=6个月,5=一年 iscanuseonsameday = pro.Iscanuseonsameday; //1当天可用,0当天不可用 pro_end = pro.Pro_end; //返回有效期 pro_youxiaoqi = new B2bComProData().GetPro_Youxiaoqi(pro.Pro_start, pro.Pro_end, provalidatemethod, appointdate, iscanuseonsameday); #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;; } } var saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (saleset != null) { phone = saleset.Service_Phone; } //查询项目电话,如果有项目电话调取项目电话 var projectdata = new B2b_com_projectData(); var projectmodel = projectdata.GetProject(projectid, comid); if (projectmodel != null) { if (projectmodel.Mobile != "") { phone = projectmodel.Mobile; } } //从cookie中得到微信号 if (Request.Cookies["openid"] != null) { openid = Request.Cookies["openid"].Value; } B2bCrmData b2b_crm = new B2bCrmData(); if (openid != "") { B2b_crm b2bmodle = b2b_crm.b2b_crmH5(openid, comid); if (b2bmodle != null) { Imprest = b2bmodle.Imprest; Integral = b2bmodle.Integral; } } } //如果是购物车产品,整体更换计算方式,以上至是读一个产品信息,并且读取用户的分销信息等 if (cart == 1) { cart_num = ""; //数量 price = 0; //单价 //获取购物车 的用户ID if (Request.Cookies["temp_userid"] != null) { userid = Request.Cookies["temp_userid"].Value; } cart_id = id; //赋值方便区分 if (userid != "") { var list = new B2bOrderData().SearchUserCartList(comid, userid, cart_id, id_speciid); if (list != null) { cart_id = ""; for (int i = 0; i < list.Count; i++) { cart_num += list[i].U_num + ","; cart_id += list[i].Id + ","; if (list[i].Speciid == 0) { price += list[i].U_num * list[i].Advise_price; //重新计算价格 } else { B2b_com_pro prospeciid = new B2bComProData().GetProspeciidById(list[i].Id.ToString(), list[i].Speciid);//如果含有规格参数 读取规格 if (prospeciid != null) { price += list[i].U_num * prospeciid.Advise_price; //重新计算价格 } } } if (cart_num != "") { if (cart_num.Substring(cart_num.Length - 1, 1) == ",") { cart_num = cart_num.Substring(0, cart_num.Length - 1); } } if (cart_id != "") { if (cart_id.Substring(cart_id.Length - 1, 1) == ",") { cart_id = cart_id.Substring(0, cart_id.Length - 1); } } } } } if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { //先通过正则表达式获取COMid comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString()); if (comid == 0) { comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid; } 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) { comlogo = FileSerivce.GetImgUrl(pro.Smalllogo.ConvertTo <int>(0)); logoimg = comlogo; } ////获取微信平台端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) { if (UserHelper.ValidateLogin()) { comid = UserHelper.CurrentCompany.ID; } projectid = Request["projectid"].ConvertTo <int>(0); nowdate = DateTime.Now.ToString("yyyy-MM-dd"); monthdate = DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd"); proid = Request["proid"].ConvertTo <int>(0); servertype = Request["servertype"].ConvertTo <int>(1); if (proid > 0) { int bindingid = new B2bComProData().GetbindingidbyProid(proid); if (bindingid > 0) { new B2bComProData().Getsalenum(bindingid, out limitbuytotalnum, out buynum); } else { new B2bComProData().Getsalenum(proid, out limitbuytotalnum, out buynum); } } //产品主图片 BindHeadPortrait(proid); ShowImgBind(proid); //产品子级图片(多图片)上传 BindChildImg(proid); //获取所属行业 B2b_company_manageuser user = UserHelper.CurrentUser(); B2b_company company = UserHelper.CurrentCompany; var comdata = B2bCompanyData.GetCompany(company.ID); if (comdata != null) { industryid = comdata.Com_type; } //判断公司是否含有项目,不含有的话,添加默认项目 int count = new B2b_com_projectData().GetProjectCountByComId(company.ID); if (count == 0) { B2b_company_info companyinfo = new B2bCompanyInfoData().GetCompanyInfo(company.ID); B2b_company_saleset saleset = B2bCompanySaleSetData.GetDirectSellByComid(company.ID.ToString()); B2b_com_project model = new B2b_com_project() { Id = 0, Projectname = company.Com_name, Projectimg = saleset.Logo.ConvertTo <int>(0), Province = companyinfo.Province.ConvertTo <string>(""), City = companyinfo.City, Industryid = company.Com_type, Briefintroduce = companyinfo.Scenic_intro, Address = companyinfo.Scenic_address, Mobile = companyinfo.Tel, Coordinate = "", Serviceintroduce = companyinfo.Serviceinfo, Onlinestate = "1", Comid = company.ID, Createtime = DateTime.Now, Createuserid = 0 }; int result = new B2b_com_projectData().EditProject(model); //设置公司下产品的项目id都改为默认项目id int result2 = new B2bComProData().UpProjectId(company.ID.ToString(), result); } }
//导入项目列表,不用后删除或者隐藏 protected void Button2_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { byte[] fileBytes = FileUpload1.FileBytes; if (ExcelRender.HasData(new MemoryStream(fileBytes))) { Stream excelFileStream = new MemoryStream(fileBytes); int sheetIndex = 0; int headerRowIndex = 0; using (excelFileStream) { using (IWorkbook workbook = new HSSFWorkbook(excelFileStream)) { using (ISheet sheet = workbook.GetSheetAt(sheetIndex)) { StringBuilder builder = new StringBuilder(); IRow headerRow = sheet.GetRow(headerRowIndex); int cellCount = headerRow.LastCellNum; //LastCellNum = PhysicalNumberOfCells int rowCount = sheet.LastRowNum; //LastRowNum = PhysicalNumberOfRows - 1 for (int i = (sheet.FirstRowNum + 1); i <= rowCount; i++) { IRow row = sheet.GetRow(i); if (row != null) { string name = GetCellValue(row.GetCell(0));//项目名称 //判断项目中是否有同名的项目,有的话不在录入 object o = ExcelSqlHelper.ExecuteScalar("select count(1) from b2b_com_project where projectname='" + name + "'"); int c = o == null ? 0 : int.Parse(o.ToString()); if (c > 0) { } else { B2b_com_project model = new B2b_com_project { Id = 0, Projectname = name, Projectimg = 0, Province = "", City = "", Industryid = 0, Briefintroduce = "", Address = "", Mobile = "", Coordinate = "", Serviceintroduce = "", Onlinestate = "0", Comid = 106, Createuserid = UserHelper.CurrentUser().Id, Createtime = DateTime.Now }; int d = new B2b_com_projectData().EditProject(model); } } if (i == rowCount) { Literal1.Text = "导入完成"; } } } } } } } }
public string projectserviceintroduce = ""; //项目服务介绍 protected void Page_Load(object sender, EventArgs e) { string u = Request.ServerVariables["HTTP_USER_AGENT"]; bool bo = detectmobilebrowser.HttpUserAgent(u); if (comid == 0) { string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower(); if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { //先通过正则表达式获取COMid comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString()); if (comid == 0) { comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid; } } else { B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl); if (companyinfo != null) { comid = companyinfo.Com_id; } } } //根据项目id得到项目信息 projectid = Request["id"].ConvertTo <int>(0); B2b_com_project mod = new B2b_com_projectData().GetProject(projectid, comid); if (mod != null) { projectname = mod.Projectname; projectbrief = mod.Briefintroduce; projectserviceintroduce = mod.Serviceintroduce; } if (comid != 0) { //if (bo == false) //{ // if (comid == 101) // { // Response.Redirect("http://vctrip.etown.cn/"); // } // Response.Redirect("http://shop" + comid + ".etown.cn"); //} B2b_company_info info = new B2bCompanyInfoData().GetCompanyInfo(comid); B2b_company com = B2bCompanyData.GetCompany(comid); if (com != null) { title = com.Com_name; } if (info != null) { article = info.Scenic_intro; merchant_intro = info.Merchant_intro; if (merchant_intro == "")//如果商家介绍为空的话,赋值景区介绍 { merchant_intro = info.Scenic_intro; } serviceinfo = info.Serviceinfo; Scenic_Takebus = info.Scenic_Takebus; Scenic_Drivingcar = info.Scenic_Drivingcar; } } if (comid != 0) { //获取微信平台端code string weixincode = Request["code"].ConvertTo <string>(""); if (weixincode != "") { int questtype = 2;//1=微信授权验证 DealUserinfo1("", weixincode, comid, questtype); } else { string openid = Request["openid"].ConvertTo <string>(""); string weixinpass = Request["weixinpass"].ConvertTo <string>(""); int questtype = 1; //1=一次性密码验证 DealUserinfo1(openid, weixinpass, comid, questtype); //判断用户微信号(1,点击的转发链接进来的2,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的) } } }
public bool issetfinancepaytype = false;//是否设置了微信支付参数 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(); id = Request["id"].ConvertTo <int>(0); nowdate = DateTime.Now.ToString("yyyy-MM-dd"); nowtoday = DateTime.Now; buyuid = Request["buyuid"].ConvertTo <int>(0); tocomid = Request["tocomid"].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 (id != 0) { B2b_com_pro pro = new B2bComProData().GetProById(id.ToString()); if (pro != null) { Ispanicbuy = pro.Ispanicbuy; //是否抢购或限购 Limitbuytotalnum = pro.Limitbuytotalnum; //限购数量 //根据产品判断商家是否含有自己的微信支付:a.含有的话支付到商家;b.没有的话支付到平台的微信公众号账户中 B2b_finance_paytype model = new B2b_finance_paytypeData().GetFinancePayTypeByComid(pro.Com_id); //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; } } //票务产品,判断 是否抢购/限购,是的话 作废超时未支付订单,完成回滚操作 if (pro_servertype == 1) { if (pro.Ispanicbuy == 1 || pro.Ispanicbuy == 2) { int rs = new B2bComProData().CancelOvertimeOrder(pro); } } iscanbook = new B2bComProData().IsYouxiao(pro.Id, pro.Server_type, pro.Pro_start, pro.Pro_end, pro.Pro_state);//判断产品是否有效:1.票务,直接判断有效期 和产品上线状态2.酒店,跟团游,当地游 则判断是否含有有效的房态/团期 以及产品上下线状态 pro_servertype = pro.Server_type; pickuppoint = pro.pickuppoint; dropoffpoint = pro.dropoffpoint; childreduce = pro.Childreduce; } if (pro.Ispanicbuy == 1) { panic_begintime = pro.Panic_begintime; panicbuy_endtime = pro.Panicbuy_endtime; TimeSpan tss = pro.Panic_begintime - nowtoday; var day = tss.Days * 24 * 3600;; //这是相差的天数 var h = tss.Hours * 3600; //这是相差的小时数, var m = tss.Minutes * 60; var s = tss.Seconds; shijiacha = day + h + m + s; } projectid = pro.Projectid; comid = pro.Com_id; pro_name = pro.Pro_name; price = pro.Advise_price; face_price = pro.Face_price; limitbuytotalnum = pro.Limitbuytotalnum; imgurl = FileSerivce.GetImgUrl(pro.Imgurl); if (price == 0) { price = 0; } else { CommonFunc.OperTwoDecimal(price.ToString()); //price = price.IndexOf(".") != -1 ? price.Substring(0, price.IndexOf(".")) : price; } if (face_price != 0) { CommonFunc.OperTwoDecimal(face_price.ToString()); } nowdate = DateTime.Now.ToString("yyyy-MM-dd"); if (pro.Service_Contain != "") { sumaryend = pro.Service_Contain; } if (pro.Service_NotContain != "") { sumaryend = sumaryend + "</br> " + pro.Service_NotContain; } if (pro.Precautions != "") { sumaryend = sumaryend + "</br> " + pro.Precautions; } Server_type = pro.Server_type; //如果服务类型是 票务; 则备注信息中 显示 电子码使用限制 //if (pro.Server_type == 1) //{ // if (pro.Iscanuseonsameday == 0)//电子码当天不可用 // { // sumaryend = "此产品当天预订不可用<br>" + sumaryend; // } // if (pro.Iscanuseonsameday == 1)//电子码当天可用 // { // sumaryend = "此产品当天预订可用<br>" + sumaryend; // } // if (pro.Iscanuseonsameday == 2)//电子码出票2小时内不可用 // { // sumaryend = "此产品出票2小时内不可用<br>" + sumaryend; // } //} remark = pro.Pro_Remark; pro_num = pro.Pro_number; if (pro_num == 0) { pro_max = 100; pro_min = 1; } else { pro_min = 1; pro_max = pro_num; } pro_explain = pro.Pro_explain; #region 产品有效期判定(微信模板--门票订单预订成功通知 中也有用到) provalidatemethod = pro.ProValidateMethod; //判断 1按产品有效期,2指定有效期 appointdate = pro.Appointdata; //1=一星期,,2=1个月,3=3个月,4=6个月,5=一年 iscanuseonsameday = pro.Iscanuseonsameday; //1当天可用,0当天不可用 DateTime pro_end = pro.Pro_end; //返回有效期 pro_youxiaoqi = new B2bComProData().GetPro_Youxiaoqi(pro.Pro_start, pro.Pro_end, provalidatemethod, appointdate, iscanuseonsameday); #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;; } } var saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (saleset != null) { phone = saleset.Service_Phone; } //查询项目电话,如果有项目电话调取项目电话 var projectdata = new B2b_com_projectData(); var projectmodel = projectdata.GetProject(projectid, comid); if (projectmodel != null) { if (projectmodel.Mobile != "") { phone = projectmodel.Mobile; } } //从cookie中得到微信号 if (Request.Cookies["openid"] != null) { openid = Request.Cookies["openid"].Value; } B2bCrmData b2b_crm = new B2bCrmData(); if (openid != "") { B2b_crm b2bmodle = b2b_crm.b2b_crmH5(openid, comid); if (b2bmodle != null) { Imprest = b2bmodle.Imprest; Integral = b2bmodle.Integral; } } } if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { //先通过正则表达式获取COMid comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString()); } if (comid == 0)//如果非标准格式,查询 是否有绑定的域名 { var wxdomain = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl); if (wxdomain != null) { comid = wxdomain.Comid; } } 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) { //根据公司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) { B2b_company_manageuser user = UserHelper.CurrentUser(); B2b_company company = UserHelper.CurrentCompany; comid = company.ID;//获取登陆账户公司id userid = user.Id.ToString(); if (comid == 0) { Response.Redirect("/");//如果没有COMID 返回 首页 } //判断商户ID(域名未绑定) if (comid != 0) { B2b_company modlecom = B2bCompanyData.GetAllComMsg(comid); if (modlecom != null) { Com_name = modlecom.Com_name; txtServiceInfo = modlecom.B2bcompanyinfo.Serviceinfo; Scenic_name = modlecom.Scenic_name; scenic_address = modlecom.B2bcompanyinfo.Scenic_address; coordinate = modlecom.B2bcompanyinfo.Coordinate; coordinatesize = modlecom.B2bcompanyinfo.Coordinatesize; weixinimg = modlecom.B2bcompanyinfo.Weixinimg; weixinname = modlecom.B2bcompanyinfo.Weixinname; Qq = modlecom.B2bcompanyinfo.Qq; } 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)); } Copyright = pro.Copyright; Tel = pro.Service_Phone; } //读取首页栏目,只读取前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 (menutotalcount == 0) { var prodata = new B2b_com_projectData(); projectlist = prodata.Projectpagelist(comid.ToString(), 1, 20, "1", out porjectcount, "", 1); } } }
public bool issetfinancepaytype = false;//是否设置了微信支付参数 public void Page_Load(object sender, EventArgs e) { string u = Request.ServerVariables["HTTP_USER_AGENT"]; bool bo = detectmobilebrowser.HttpUserAgent(u); projectid = Request["projectid"].ConvertTo <int>(0); key = Request["q"].ConvertTo <string>(""); if (key != "") { title_view = key; } uid = Request["uid"].ConvertTo <int>(0); //获取IP地址 uip = CommonFunc.GetRealIP(); if (key == "") { 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; setsearch = commodel.Setsearch; } 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)); } unyuding = new B2b_com_projectData().GetProjectUnyuding(projectid); //读取项目名称 if (projectid != 0) { B2b_com_project prjdata = new B2b_com_projectData().GetProject(projectid, comid); if (prjdata != null) { title_view = prjdata.Projectname; Serviceintroduce = prjdata.Serviceintroduce; Coordinate = prjdata.Coordinate; Address = prjdata.Address; Projcetimg = FileSerivce.GetImgUrl(prjdata.Projectimg); } } } //微信转发访问归属渠道 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); } } } }