96 lines
3.9 KiB
C#
96 lines
3.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
namespace Mtxfw.shop
|
|
{
|
|
public partial class Telesa : System.Web.UI.MasterPage
|
|
{
|
|
public Dictionary<int, string> Menu = null;
|
|
public Mtxfw.DAL.Article daoArt = new Mtxfw.DAL.Article();
|
|
public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config();
|
|
public Mtxfw.DAL.P_Product daoProduct = new Mtxfw.DAL.P_Product();
|
|
public Mtxfw.DAL.P_Category daoCategory = new Mtxfw.DAL.P_Category();
|
|
public Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info();
|
|
public string cartcount = "0",IFApp="0";
|
|
public static string appKey = "", Token = "qbccandgengliu", signature = "", timestamp = "", nonceStr = "", strurl="";
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
if (!String.IsNullOrEmpty(Request.QueryString["invieuser"]))
|
|
{
|
|
int ContactID = Convert.ToInt32(Request.QueryString["invieuser"].ToString());
|
|
if (Session["VContactID"] == null)
|
|
{
|
|
Session["VContactID"] = ContactID;
|
|
}
|
|
}
|
|
if (!String.IsNullOrEmpty(Request.QueryString["returnurl"]))
|
|
{
|
|
Session["returnurl"] = Request.QueryString["returnurl"].ToString();
|
|
}
|
|
}
|
|
|
|
|
|
string str_u = Request.ServerVariables["HTTP_USER_AGENT"];
|
|
//Mtxfw.Utility.Common.WriteHtml("/weixin/HTTP_USER_AGENT.txt", str_u);
|
|
if (str_u.IndexOf("Mobile Safari/537.36") != -1)
|
|
{
|
|
if (Request.Url.ToString().ToLower().IndexOf("/default.aspx") != -1)
|
|
{
|
|
|
|
}
|
|
}
|
|
if (str_u.IndexOf("MicroMessenger") != -1)
|
|
{
|
|
//微信访问
|
|
IFApp = "1";
|
|
if (Session["MemberId"] != null)
|
|
{
|
|
/*int MemberId = int.Parse(Session["MemberId"].ToString());
|
|
Mtxfw.Model.user_info ModelUser = daoUser.GetModel(MemberId);
|
|
if (ModelUser != null)
|
|
{
|
|
if (ModelUser.uLevel6 == 0 && Request.Url.ToString().ToLower().IndexOf("/default.aspx") != -1)
|
|
{
|
|
Response.Redirect("/shop_products.aspx");
|
|
}
|
|
}*/
|
|
}
|
|
else
|
|
{
|
|
//if (Request.Url.ToString().ToLower().IndexOf("/default.aspx") != -1)
|
|
//{
|
|
/*if (Request.QueryString["logout"] == null && Request.Url.ToString().ToLower().IndexOf("/login.aspx") == -1 && Request.Url.ToString().ToLower().IndexOf("/weixin.aspx") == -1 && Request.Url.ToString().ToLower().IndexOf("/article.aspx") == -1)
|
|
{
|
|
string RUrl = Request.Url.ToString();
|
|
Session["returnurl"] = RUrl;
|
|
Response.Redirect("/weixinlogin.aspx");
|
|
}*/
|
|
//}
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
protected String GetProvince()
|
|
{
|
|
StringBuilder sb = new StringBuilder();
|
|
Mtxfw.DAL.province daoPro = new Mtxfw.DAL.province();
|
|
System.Data.DataSet Ds = daoPro.GetCacheList("", "1=1 Order by Id Asc", "Province");
|
|
System.Data.DataTable Dt = (Ds != null && Ds.Tables[0] != null) ? Ds.Tables[0] : null;
|
|
foreach (System.Data.DataRow Dr in Dt.Rows)
|
|
{
|
|
sb.Append("<option value=\"" + Dr["ProvinceID"] + "\">" + Dr["ProvinceName"] + "</option>\r\n");
|
|
}
|
|
return sb.ToString();
|
|
}
|
|
|
|
|
|
}
|
|
} |