public static string GetimageLibraryByid(int id) { int totalcount = 0; try { var list = B2bCompanyImageData.GetimageLibraryByid(id); if (list == null) { return(JsonConvert.SerializeObject(new { type = 1, msg = "没有查询到图片", totalCount = 0 })); } IEnumerable result = ""; if (list != null) { list.Imgurl_address = FileSerivce.GetImgUrl(list.Imgurl);//获取图片实际地址 } return(JsonConvert.SerializeObject(new { type = 100, msg = list, totalCount = totalcount })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string UpDownState(int comid, int id, int channelcompanyid = 0) { try { int state = 0; //获取原来的状态,无法获得都暂停 var imgdata = B2bCompanyImageData.GetimageByComid(comid, id, channelcompanyid); if (imgdata != null) { if (imgdata.State == 0) { state = 1; } } var saledata = new B2bCompanyImageData(); var crmid = saledata.UpDownState(comid, id, state); return(JsonConvert.SerializeObject(new { type = 100, msg = crmid })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
protected void Page_Load(object sender, EventArgs e) { comid = Request["comid"].ConvertTo <int>(0); //Banner int totalcount = 0; var Linkurl = "/ui/shangjiaui/H5Setlist.aspx"; B2bCompanyImageData imgdata = new B2bCompanyImageData(); List <B2b_company_image> imglist = imgdata.PageGetimageList(comid, 0, out totalcount); if (imglist != null) { for (int i = 0; i < totalcount; i++) { if (title_arr == "") { title_arr = "\\\"" + imglist[i].Title + "\\\""; img_arr = "\\\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\""; url_arr = "\\\"" + Linkurl.Replace("/", "\\\\\\/") + "\\\"";; } else { title_arr += "," + "\\\"" + imglist[i].Title + "\\\""; img_arr += "," + "\\\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\""; url_arr += "," + "\\\"" + Linkurl.Replace("/", "\\\\\\/") + "\\\"";; } } } }
public static string PageGetimagelist(int comid, int typeid) { //typeid 0 =微网站Banner, 1=门市Banner int totalcount = 0; try { var imagedata = new B2bCompanyImageData(); List <B2b_company_image> list = imagedata.PageGetimageList(comid, typeid, out totalcount); 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, Title = pro.Title, Typeid = pro.Typeid, State = pro.State == 1 ?"上线":"下线" }; } 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) { string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower(); if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString()); } else { B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl); if (companyinfo != null) { comid = companyinfo.Com_id; } } if (comid != 0) { B2b_company company = B2bCompanyData.GetCompany(comid); if (company != null) { companyname = company.Com_name; tel = company.B2bcompanyinfo.Tel; } } //Banner int totalcount = 0; B2bCompanyImageData imgdata = new B2bCompanyImageData(); List <B2b_company_image> imglist = imgdata.PageGetimageList(comid, 0, out totalcount); if (imglist != null) { bannerstr = "<ul> "; bannerolstr = " <ol>"; for (int i = 0; i < totalcount; i++) { bannerstr += "<li><a onclick=\"return false;\"> <img src=\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl) + "\" alt=\"" + imglist[i].Title + "\" style=\"width:100%;\" /></a></li>"; if (i == 0) { bannerolstr += "<li class=\"on\"></li>"; } else { bannerolstr += "<li ></li>"; } } bannerstr += "</ul>" + bannerolstr + "</ol>"; } }
protected void Page_Load(object sender, EventArgs e) { //string u = Request.ServerVariables["HTTP_USER_AGENT"]; //bool bo = detectmobilebrowser.HttpUserAgent(u); bool bo = true; string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower(); if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString()); } else { B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl); if (companyinfo != null) { comid = companyinfo.Com_id; } } if (comid != 0) { B2b_company company = B2bCompanyData.GetCompany(comid); if (company != null) { companyname = company.Com_name; } } //Banner int totalcount = 0; B2bCompanyImageData imgdata = new B2bCompanyImageData(); List <B2b_company_image> imglist = imgdata.PageGetimageList(comid, 0, out totalcount); if (imglist != null) { for (int i = 0; i < totalcount; i++) { if (title_arr == "") { title_arr = "\\\"" + imglist[i].Title + "\\\""; img_arr = "\\\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\""; url_arr = "\\\"" + imglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";; } else { title_arr += "," + "\\\"" + imglist[i].Title + "\\\""; img_arr += "," + "\\\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\""; url_arr += "," + "\\\"" + imglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";; } } } }
public static string GetimageByComid(int comid, int id) { try { B2b_company_image com = B2bCompanyImageData.GetimageByComid(comid, id); return(JsonConvert.SerializeObject(new { type = 100, msg = com })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); } }
//图片添加修改 public static string InsertOrUpdate(B2b_company_image saleset) { try { var saledata = new B2bCompanyImageData(); var crmid = saledata.InsertOrUpdate(saleset); return(JsonConvert.SerializeObject(new { type = 100, msg = crmid })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string Deleteimage(int comid, int id) { try { var saledata = new B2bCompanyImageData(); var crmid = saledata.Deleteimage(comid, id); return(JsonConvert.SerializeObject(new { type = 100, msg = crmid })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
/// <summary> /// 插入图片 /// </summary> /// <param name="order"></param> /// <returns></returns> public static string LibraryInsertOrUpdate(b2b_image_library model) { using (var helper = new SqlHelper()) { try { B2bCompanyImageData modeldata = new B2bCompanyImageData(); int orderid = modeldata.LibraryInsertOrUpdate(model); return(JsonConvert.SerializeObject(new { type = 100, msg = orderid })); } catch (Exception ex) { helper.Rollback(); return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); } } }
public static string GetfontLibraryList(int usetype, int pageindex, int pagesize) { int totalcount = 0; try { B2bCompanyImageData modedata = new B2bCompanyImageData(); var list = modedata.GetfontLibraryList(usetype, pageindex, pagesize, out totalcount); return(JsonConvert.SerializeObject(new { type = 100, msg = list, totalCount = totalcount })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
protected void Page_Load(object sender, EventArgs e) { comid = Request["comid"].ConvertTo <int>(0); if (comid != 0) { B2b_company company = B2bCompanyData.GetCompany(comid); if (company != null) { companyname = company.Com_name; tel = company.B2bcompanyinfo.Tel; } } //Banner int totalcount = 0; B2bCompanyImageData imgdata = new B2bCompanyImageData(); List <B2b_company_image> imglist = imgdata.PageGetimageList(comid, 0, out totalcount); if (imglist != null) { bannerstr = "<ul> "; bannerolstr = " <ol>"; for (int i = 0; i < totalcount; i++) { bannerstr += "<li><a onclick=\"return false;\"> <img src=\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl) + "\" alt=\"" + imglist[i].Title + "\" style=\"width:100%;\" /></a></li>"; if (i == 0) { bannerolstr += "<li class=\"on\"></li>"; } else { bannerolstr += "<li ></li>"; } } bannerstr += "</ul>" + bannerolstr + "</ol>"; } }
private void ShowImgBind() { var comid = UserHelper.CurrentCompany.ID; if (id != 0) { var imagemodel = B2bCompanyImageData.GetimageLibraryByid(id); if (imagemodel != null) { usetype = imagemodel.Usetype; modelid = imagemodel.Modelid; FileUploadModel identityFileUpload = new FileUploadData().GetFileById(imagemodel.Imgurl); if (identityFileUpload != null) { headPortraitImgSrc = identityFileUpload.Relativepath; } } } }
public static string GetimageLibraryList(int usetype, int pageindex, int pagesize, int modelid = 0) { int totalcount = 0; try { B2bCompanyImageData modedata = new B2bCompanyImageData(); var modelmodel = new B2bModelData(); var list = modedata.GetimageLibraryList(usetype, pageindex, pagesize, out totalcount, modelid); if (list == null) { return(JsonConvert.SerializeObject(new { type = 1, msg = "没有查询到图片", totalCount = 0 })); } IEnumerable result = ""; if (list != null) { result = from pro in list select new { Id = pro.Id, Imgurl_address = FileSerivce.GetImgUrl(pro.Imgurl), Imgurl = pro.Imgurl, Usetype = pro.Usetype, Width = pro.Width, Height = pro.Height, ModelName = modelmodel.GetModelById(pro.Modelid) == null ? "" : modelmodel.GetModelById(pro.Modelid).Title }; } return(JsonConvert.SerializeObject(new { type = 100, msg = result, totalCount = totalcount })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
private void ShowImgBind() { //var comid = Context.Request["comid"].ConvertTo<int>(0); var comid = UserHelper.CurrentCompany.ID; if (id != 0) { B2b_company_image imagemodel = B2bCompanyImageData.GetimageByComid(comid, id); if (imagemodel != null) { Title = imagemodel.Title; linkurl = imagemodel.Linkurl; FileUploadModel identityFileUpload = new FileUploadData().GetFileById(imagemodel.Imgurl); if (identityFileUpload != null) { headPortraitImgSrc = identityFileUpload.Relativepath; } } } }
public string userid = "0";//用户临时 Uid 或 实际Uid public void Page_Load(object sender, EventArgs e) { string u = Request.ServerVariables["HTTP_USER_AGENT"]; bool bo = detectmobilebrowser.HttpUserAgent(u); uid = Request["uid"].ConvertTo <int>(0); //获取IP地址 uip = CommonFunc.GetRealIP(); key = Request["key"].ConvertTo <string>(""); if (key != "") { biaoti = key; } proclass = Request["class"].ConvertTo <int>(0); price = Request["price"].ConvertTo <int>(0); //获取随机用户ID if (Request.Cookies["temp_userid"] != null) { userid = Request.Cookies["temp_userid"].Value; } else { userid = Domain_def.HuoQu_Temp_UserId(); //Response.Cookies("userid").val(); HttpCookie cookie = new HttpCookie("temp_userid"); //实例化HttpCookie类并添加值 cookie.Value = userid; cookie.Expires = DateTime.Now.AddDays(365); Response.Cookies.Add(cookie); } if (proclass != 0) { var prodata = new B2bComProData(); var result = prodata.Proclassbyid(proclass); if (result != null) { biaoti = result.Classname; } } buyuid = Request["buyuid"].ConvertTo <int>(0); tocomid = Request["tocomid"].ConvertTo <int>(0); if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { //先通过正则表达式获取COMid comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString()); } if (comid == 0)//如果非标准格式,查询 是否有绑定的域名 { var domaincomid = B2bCompanyData.GetComId(RequestUrl); if (domaincomid != null) { comid = domaincomid.Com_id; } } if (comid != 0) { var commodel = B2bCompanyData.GetCompany(comid); if (commodel != null) { if (commodel.B2bcompanyinfo != null) { Wxfocus_url = commodel.B2bcompanyinfo.Wxfocus_url; Wxfocus_author = commodel.B2bcompanyinfo.Wxfocus_author; weixinname = commodel.B2bcompanyinfo.Weixinname; Scenic_intro = commodel.B2bcompanyinfo.Scenic_intro; } title = commodel.Com_name; } B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (pro != null) { if (pro.Smalllogo != null && pro.Smalllogo != "") { comlogo = FileSerivce.GetImgUrl(pro.Smalllogo.ConvertTo <int>(0)); } } //获取微信平台端code string weixincode = Request["code"].ConvertTo <string>(""); //获取微信号和一次性密码 openid = Request["openid"].ConvertTo <string>(""); string weixinpass = Request["weixinpass"].ConvertTo <string>(""); //获得会员信息 GetCrmInfo(weixincode, openid, weixinpass); } //获取BANNER,及logo if (comid != 0) { var imagedata = new B2bCompanyImageData(); int totalcount = 0; List <B2b_company_image> list = imagedata.PageGetimageList(comid, 2, out totalcount); if (list != null) { for (int i = 0; i < totalcount; i++) { bannerimg = FileSerivce.GetImgUrl(list[i].Imgurl); bannerlink = list[i].Linkurl; bannertitle = list[i].Title; } } //根据公司id得到 直销设置 B2b_company_saleset saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString()); if (saleset != null) { logoimg = FileSerivce.GetImgUrl(saleset.Smalllogo.ConvertTo <int>(0)); } //读取首页栏目,只读取前10个栏目,太多影响打开 var shopmenudata = new B2bCompanyMenuData(); menulist = shopmenudata.GetMenuList(comid, 1, 10, out menutotalcount, 1); if (menulist != null) { for (int i = 0; i < menutotalcount; i++) { menulist[i].Imgurl_address = FileSerivce.GetImgUrl(menulist[i].Imgurl); } } } //微信转发访问归属渠道 if (uid != 0)//必须记录转发用户信息才能继续统计 { //判断有转发人的渠道 var crmdata = new B2bCrmData(); var pro = crmdata.Readuser(uid, comid);//读取转发人用户信息 string zhuanfa_phone = ""; if (pro != null) { zhuanfa_phone = pro.Phone; } if (zhuanfa_phone != "") { //转发人手机存在 MemberChannelData channeldata = new MemberChannelData(); var channeinfo = channeldata.GetPhoneComIdChannelDetail(zhuanfa_phone, comid); //查询渠道 if (channeinfo != null) { //转发人渠道记录COOKI HttpCookie cookie = new HttpCookie("ZF_ChanneId"); //实例化HttpCookie类并添加值 cookie.Value = channeinfo.Id.ToString(); cookie.Expires = DateTime.Now.AddDays(120); Response.Cookies.Add(cookie); } } } }
public Member_Channel_company menshi = null;//门店信息 protected void Page_Load(object sender, EventArgs e) { //string u = Request.ServerVariables["HTTP_USER_AGENT"]; //bool bo = detectmobilebrowser.HttpUserAgent(u); string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower(); if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid { comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString()); } else { B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl); if (companyinfo != null) { comid = companyinfo.Com_id; } } #region 递过来门市id,通过门市id获得门市信息 menshiid = Request["menshiid"].ConvertTo <int>(0); if (menshiid > 0) { menshi = new MemberChannelcompanyData().GetChannelCompany(menshiid.ToString()); if (menshi != null) { menshiimgurl = FileSerivce.GetImgUrl(menshi.Companyimg); companyname = menshi.Companyname; comid = menshi.Com_id; } } #endregion ////默认图片 //string defaultimg = "/Images/StoreDefault.jpg"; //title_arr = "\\\"" + companyname + "\\\""; //img_arr = "\\\"" + defaultimg.Replace("/", "\\\\\\/") + "\\\""; //url_arr = "\\\"" + "#" + "\\\""; ; int totalcount = 0; B2bCompanyImageData imgdata = new B2bCompanyImageData(); //Banner,调取门市总社图片 List <B2b_company_image> channelimglist = imgdata.PageChannelGetimageList(comid, menshiid, out totalcount); if (channelimglist != null) { for (int i = 0; i < totalcount; i++) { if (title_arr == "") { title_arr = "\\\"" + channelimglist[i].Title + "\\\""; img_arr = "\\\"" + FileSerivce.GetImgUrl(channelimglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\""; url_arr = "\\\"" + channelimglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";; } else { title_arr += "," + "\\\"" + channelimglist[i].Title + "\\\""; img_arr += "," + "\\\"" + FileSerivce.GetImgUrl(channelimglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\""; url_arr += "," + "\\\"" + channelimglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";; } } } //Banner,调取总社图片 List <B2b_company_image> imglist = imgdata.PageGetimageList(comid, 1, out totalcount); if (imglist != null) { for (int i = 0; i < totalcount; i++) { if (title_arr == "") { title_arr = "\\\"" + imglist[i].Title + "\\\""; img_arr = "\\\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\""; url_arr = "\\\"" + imglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";; } else { title_arr += "," + "\\\"" + imglist[i].Title + "\\\""; img_arr += "," + "\\\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\""; url_arr += "," + "\\\"" + imglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";; } } } }
/// <summary> /// 选定模板 /// </summary> /// <param name="order"></param> /// <returns></returns> public static string SelectModel(int modelid, int comid) { using (var helper = new SqlHelper()) { int totalcount = 0; int totalcount1 = 0; try { B2bModelData modeldata = new B2bModelData(); var b2bmodel = modeldata.GetModelById(modelid); var b2bmodelmenu = modeldata.ModelMenuPageList(modelid, 1, 100, out totalcount); if (b2bmodel != null) { var delemodel = modeldata.DeleteSelectModel(comid);//删除已选择模板 H5_html model = new H5_html(); model.Comid = comid; model.Modelid = modelid; model.Style_str = b2bmodel.Style_str; model.Html_str = b2bmodel.Html_str; //插入模板 int orderid = modeldata.SelectModel(model); //原有图片都下线 var saledata = new B2bCompanyImageData(); var bannerlist = saledata.UpAllDownState(comid); //插入默认banner(也用于背景图片),重新选择模板后可能重复插入 B2bCompanyImageData modedata = new B2bCompanyImageData(); var imglist = modedata.GettypemodelidimageLibraryList(1, modelid, 1, 3, out totalcount1); if (imglist != null) { for (int i = 0; i < imglist.Count; i++) { B2b_company_image imagemodel = new B2b_company_image() { Id = 0, Com_id = comid, Typeid = 0, Imgurl = imglist[i].Imgurl, Linkurl = "#", Title = "#", Channelcompanyid = 0, }; var crmid = saledata.InsertOrUpdate(imagemodel); } } if (b2bmodelmenu != null)//首先判断模板里是否有默认栏目 { var insertmenu = 0; var imagedata = new B2bCompanyMenuData(); var list = imagedata.GetMenuList(comid, 1, 10, out totalcount);//如果已经有菜单的模板将不删除菜单,以后可增加判断是否删除菜单,有利于方便切换模板导航不需要重复修改,但容易出现因栏目图片不符新模板而影响使用。可先删除已有模板再进行切换 if (totalcount == 0) { insertmenu = modeldata.InsertSelectModelMenu(modelid, comid);//插入已选择模板菜单 } //var deletemenu= modeldata.DeleteSelectModelMenu(comid);//删除已选择模板菜单 return(JsonConvert.SerializeObject(new { type = 100, msg = insertmenu })); } } return(JsonConvert.SerializeObject(new { type = 1, msg = "选择模板错误,请重新尝试" })); } catch (Exception ex) { helper.Rollback(); return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); } } }