📄 config.cs
字号:
val=val+","+dt.Rows[i][field].ToString();
}
}
return val;
}
public string GetIsIndexViewSql(string Product_Id)
{
string str_Sql="";
if (GetRsCount("ProductDetail where Product_Id="+Product_Id+" and IsHot=1")>0)
{
// 1.===获得资源表信息===
string[] ref_Fileds={"DefaultOrderId","HotCount"};
string[] ref_Ctrls={"",""};
GetDetail(ref_Fileds,ref ref_Ctrls,"Select top 1 DefaultOrderId,HotCount from ProductDetail where Product_Id="+Product_Id+" and IsHot=1");
string DefaultOrderId=ref_Ctrls[0]; // 排序
string HotCount=ref_Ctrls[1]; // 首页显示几条热酷
// 热酷所有Id
string HotAllId=GetFiledStr1(HotCount,"Id","ProductDetail where Product_Id="+Product_Id+" order by Count desc");
str_Sql=@"SELECT *
FROM ((SELECT DefaultOrderId,id, product_Id, ringdetail_id, parent_Id, name, 0 Location,
Oico_Url,-1 Type,IsFree,url,IsHot
FROM ProductDetail a
WHERE a.product_Id = 1 AND IsDefaultView = 1)
UNION ALL
(SELECT (SELECT DefaultOrderId
FROM ProductDetail a
WHERE a.id = b.parent_id AND a.product_Id = {0} AND a.IsDefaultView = 1)
defaultOrderId, parent_Id id, product_Id, 0 ringdetail_id, 0 parent_Id, name,
Location, '' Oico_Url,type,0 IsFree,url,0 IsHot
FROM ProductRingHref b
WHERE b.parent_Id IN
(SELECT id
FROM ProductDetail a
WHERE a.product_Id = {0} AND IsDefaultView = 1) and product_Id={0} and b.type in (3,4,8))) e
union all
(SELECT top {1} {2} DefaultOrderId,id, product_Id, ringdetail_id, parent_Id, name, 0 Location,
Oico_Url,-1 Type,IsFree,url,1 IsHot
FROM ProductDetail a
WHERE a.product_Id = {0} and IsFree=0 and RingDetail_Id<>0 and id in ({3}))
ORDER BY DefaultOrderId, Location DESC";
str_Sql=string.Format(str_Sql,Product_Id,HotCount,DefaultOrderId,HotAllId);
}
else
{
str_Sql=@"SELECT *
FROM ((SELECT DefaultOrderId,id, product_Id, ringdetail_id, parent_Id, name, 0 Location,
Oico_Url,-1 Type,IsFree,url,IsHot
FROM ProductDetail a
WHERE a.product_Id = {0} AND IsDefaultView = 1)
UNION ALL
(SELECT (SELECT DefaultOrderId
FROM ProductDetail a
WHERE a.id = b.parent_id AND a.product_Id = {0} AND a.IsDefaultView = 1)
defaultOrderId, parent_Id id, product_Id, 0 ringdetail_id, 0 parent_Id, name,
Location, '' Oico_Url,type,0 IsFree,url,0 IsHot
FROM ProductRingHref b
WHERE b.parent_Id IN
(SELECT id
FROM ProductDetail a
WHERE a.product_Id = {0} AND IsDefaultView = 1) and product_Id={0} and b.type in (3,4,8))) e
ORDER BY DefaultOrderId, Location DESC";
str_Sql=string.Format(str_Sql,Product_Id);
}
// // ===首页显示列表===
// string str_Sql=@"SELECT *
// FROM (SELECT DefaultOrderId,id, product_Id, RingDetail_Id, parent_Id, name, 0 Location,
// Oico_Url,-1 Type,IsFree,url,IsHot
// FROM ProductDetail a
// WHERE a.product_Id = {0} AND IsDefaultView = 1
// UNION ALL
// (SELECT (SELECT DefaultOrderId
// FROM ProductDetail a
//
//
//
// WHERE a.id = b.parent_id AND a.product_Id = {0} AND a.IsDefaultView = 1)
// defaultOrderId, parent_Id id, product_Id, 0 RingDetail_Id, 0 parent_Id, name,
// Location, '' Oico_Url,type,0 IsFree,url,0 IsHot
// FROM ProductRingHref b
// WHERE b.parent_Id IN
// (SELECT id
// FROM ProductDetail a
// WHERE a.product_Id = {0} AND IsDefaultView = 1) and product_Id={0} and b.type in (4,8))) e
// ORDER BY DefaultOrderId, Location DESC";
return str_Sql;
}
/// <summary>
/// ===获得铃声列表指向链接===
/// </summary>
/// <param name="RingDetail_Id">铃声Id</param>
/// <param name="Parent_Id">Parent_Id</param>
/// <returns></returns>
public string GetIndexUrl(string RingDetail_Id,string Parent_Id)
{
if (RingDetail_Id.Replace(" ","")=="0")
{
return "ProductDetail.aspx?Parent_Id="+Parent_Id+"&ReturnType=Default";
}
else
{
return "DownLoad.aspx?RingDetail_Id="+RingDetail_Id+"&Parent_Id="+Parent_Id+"&ReturnType=Default";
}
}
/// <summary>
/// 如果Location等于0,说明是ProductDetail记录
/// </summary>
/// <param name="type">0表示是ProductDetail记录</param>
/// <returns></returns>
public bool ViewLocation0(string Location)
{
if (Location=="0")
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 如果Location等于1,-1,type等于3,说明是ProductRingHref记录而且是插入修饰图片
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public bool ViewLocationB0Type3(string Location)
{
if (Location=="-1" || Location=="1")
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 插入小图标
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public bool ViewIco(string type)
{
if (type.Replace(" " ,"")=="")
{
return false;
}
else
{
return true;
}
}
/// <summary>
/// ===获得首页铃声列表===
/// </summary>
/// <param name="Type"></param>
/// <param name="IsFree"></param>
/// <param name="RingDetail_Id"></param>
/// <param name="Parent_Id"></param>
/// <param name="Url"></param>
/// <returns></returns>
public string GetDefaultUrl(string Type,string IsFree,string RingDetail_Id,string Id,string Parent_Id,string Url,string IsHot)
{
string ReturnVal="";
// 所有的:Type:-1表示主栏目或者歌曲,产品推荐0, 栏目推荐为1, 铃声推荐为2, 直接连接推荐为3,为插入更多4, 插入特殊连接5, 插入图片为8
// 所有的:Type:-1表示主栏目或者歌曲,为插入更多4, 插入特殊连接5
if (Type.Replace(" ","")=="-1")
{
if (RingDetail_Id.Replace(" ","")=="0") // 栏目
{
if (IsHot=="1") // 热酷
{
ReturnVal="HotProductDetail.aspx?Parent_Id="+Id;
}
else
{
if (Url.Replace(" ","")=="")
{
ReturnVal="ProductDetail.aspx?Parent_Id="+Id;
}
else
{
ReturnVal=Url+"?Parent_Id="+Id;
}
}
}
else
{
if (IsFree=="1") // 免费
{
ReturnVal="DownLoadMessage.aspx?RingDetail_Id="+RingDetail_Id+"&Parent_Id="+Parent_Id+"&ReturnType=ProductDetail.aspx";
}
else
{
if (IsHot=="1") // 热酷
{
ReturnVal="DownLoad.aspx?RingDetail_Id="+RingDetail_Id+"&Parent_Id="+Parent_Id+"&ReturnType=HotProductDetail.aspx";
}
else
{
ReturnVal="DownLoad.aspx?RingDetail_Id="+RingDetail_Id+"&Parent_Id="+Parent_Id+"&ReturnType=ProductDetail.aspx";
}
}
}
}
else if (Type.Replace(" ","")=="4") // 插入更多4
{
ReturnVal=Url;
}
// else if (Type.Replace(" ","")=="5") // 插入特殊连接5
// {
// ReturnVal=Url;
// }
else if (Type.Replace(" ","")=="100") // 插入一个指定连接100
{
ReturnVal="DownLoad.aspx?RingDetail_Id="+RingDetail_Id+"&Parent_Id="+Parent_Id+"&ReturnType="+Url;
}
return ReturnVal;
}
/// <summary>
/// 获得第二级页面列表
/// </summary>
/// <param name="Type"></param>
/// <param name="IsFree"></param>
/// <param name="RingDetail_Id"></param>
/// <param name="Id"></param>
/// <param name="Parent_Id"></param>
/// <param name="Url"></param>
/// <returns></returns>
public string GetProductDetailUrl(string Type,string IsFree,string RingDetail_Id,string Id,string Parent_Id,string Url)
{
string ReturnVal="";
// 所有的:Type:-1表示主栏目或者歌曲,产品推荐0, 栏目推荐为1, 铃声推荐为2, 直接连接推荐为3,为插入更多4, 插入特殊连接5, 插入图片为8
// 所有的:Type:-1表示主栏目或者歌曲,为插入更多4, 插入特殊连接5
if (Type.Replace(" ","")=="-1")
{
if (RingDetail_Id.Replace(" ","")=="0") // 栏目
{
ReturnVal="ProductDetail.aspx?Parent_Id="+Id;
}
else
{
if (IsFree=="1") // 免费
{
ReturnVal="DownLoadMessage.aspx?RingDetail_Id="+RingDetail_Id+"&Parent_Id="+Parent_Id+"&ReturnType=ProductDetail.aspx";
}
else
{
ReturnVal="DownLoad.aspx?RingDetail_Id="+RingDetail_Id+"&Parent_Id="+Parent_Id+"&ReturnType=ProductDetail.aspx";
}
}
}
else if (Type.Replace(" ","")=="4") // 插入更多4
{
ReturnVal=Url;
}
// else if (Type.Replace(" ","")=="5") // 插入特殊连接5
// {
// ReturnVal=Url;
// }
else if (Type.Replace(" ","")=="100") // 插入一个指定连接100
{
ReturnVal="DownLoad.aspx?RingDetail_Id="+RingDetail_Id+"&Parent_Id="+Parent_Id+"&ReturnType="+Url;
}
return ReturnVal;
}
/// <summary>
/// -1表示主栏目或者歌曲,产品推荐0, 栏目推荐为1, 铃声推荐为2, 直接连接推荐为3,为插入更多4, 插入特殊连接5, 插入图片为8
/// </summary>
/// <param name="Location"></param>
/// <returns></returns>
public bool GetDefaultIsView(string Type, string PrescribeType)
{
if (Type==PrescribeType)
{
return true;
}
else
{
return false;
}
}
// ===设置上级返回连接,以及歌词连接===
public void SetRuturnTypeLyric(System.Web.UI.MobileControls.Link lnk_Return,System.Web.UI.MobileControls.Link lnk_Lyric)
{
for (int i=0;i<HttpContext.Current.Request.QueryString.Count;i++)
{
if (HttpContext.Current.Request.QueryString.Keys[i].ToString()=="ReturnType")
{
// ===返回连接===
lnk_Return.NavigateUrl=HttpContext.Current.Request.QueryString[i].ToString()+"?"+HttpContext.Current.Request.QueryString.ToString();
// ===歌词连接===
lnk_Lyric.NavigateUrl="Lyric.aspx?"+HttpContext.Current.Request.QueryString.ToString();
break;
}
}
}
/// <summary>
/// 获得二级正常浏览页面的:标题+(记数)
/// </summary>
/// <param name="RingDetail_Id">目录为0,铃声不为0</param>
/// <param name="Name">标题</param>
/// <param name="Count">点击数</param>
/// <returns></returns>
public string GetTwoPageNameCount(string RingDetail_Id,string Name,string Count)
{
string Val="";
if (RingDetail_Id=="0")
{
Val=Name;
}
else
{
Val=Name+"("+Count+")";
}
return Val;
}
/// <summary>
/// 设置ProductDetail页面基本信息,包括栏目标题,返回上一级连接,绑定铃声列表,推荐连接列表
/// </summary>
/// <param name="Product_Id">产品Id</param>
/// <param name="Parent_Id">传递父Id</param>
/// <param name="lbl_Name">标题</param>
/// <param name="lnk_Return">返回上一级</param>
/// <param name="olst">铃声列表</param>
/// <param name="olst_Herf">推荐连接列表</param>
public void SetProductDetailBasicMessage(string Product_Id,string Parent_Id,System.Web.UI.MobileControls.Label lbl_Name,System.Web.UI.MobileControls.TextView Introduct,System.Web.UI.MobileControls.Link lnk_Return,ObjectList olst,ObjectList olst_Herf)
{
// ===获得基本信息===
string[] ref_Fileds={"Name","Parent_Id","Introduct"};
string[] ref_Ctrls={"","",""};
GetDetail(ref_Fileds,ref ref_Ctrls,"Select * from ProductDetail where Id="+Parent_Id+" order by Count Desc");
// ===标题===
lbl_Name.Text=ref_Ctrls[0];
Introduct.Text=ref_Ctrls[2];
if (Introduct.Text.Replace(" ","")=="") // 假设为空,应隐藏!
{
Introduct.Visible=false;
}
else
{
Introduct.Visible=true;
}
// ===返回上一页===
if (ref_Ctrls[1].ToString()=="0")
{
lnk_Return.NavigateUrl="Default.aspx";
}
else
{
lnk_Return.NavigateUrl="ProductDetail.aspx?Parent_id="+ref_Ctrls[1].ToString();
}
// ===歌曲列表===
BindCtrl("Select *,-1 Type,'' Url from ProductDetail where Parent_Id="+Parent_Id+" and Product_Id="+Product_Id+" order by [Count] Desc","","",olst);
// Type:-1表示主栏目或者歌曲,产品推荐0, 栏目推荐为1, 铃声推荐为2, 直接连接推荐为3,为插入更多4, 插入特殊连接5, 插入图片为8
// ===连接推荐===
BindCtrl("Select * from ProductRingHref where Parent_Id="+Parent_Id+" and Product_Id="+Product_Id+" and Type in (0,1,2,3) order by Id","","",olst_Herf);
if (olst_Herf.Items.Count==0)
{
olst_Herf.Visible=false;
}
}
public void SetProductDetailBasicMessage(string Product_Id,string Parent_Id,System.Web.UI.MobileControls.Label lbl_Name,System.Web.UI.MobileControls.TextView Introduct,System.Web.UI.MobileControls.Link lnk_Return,ObjectList olst)
{
// ===获得基本信息===
string[] ref_Fileds={"Name","Parent_Id","Introduct"};
string[] ref_Ctrls={"","",""};
GetDetail(ref_Fileds,ref ref_Ctrls,"Select * from ProductDetail where Id="+Parent_Id+" order by Count Desc");
// ===标题===
lbl_Name.Text=ref_Ctrls[0];
Introduct.Text=ref_Ctrls[2];
if (Introduct.Text.Replace(" ","")=="") // 假设为空,应隐藏!
{
Introduct.Visible=false;
}
else
{
Introduct.Visible=true;
}
// ===返回上一页===
if (ref_Ctrls[1].ToString()=="0")
{
lnk_Return.NavigateUrl="Default.aspx";
}
else
{
lnk_Return.NavigateUrl="ProductDetail.aspx?Parent_id="+ref_Ctrls[1].ToString();
}
// ===歌曲列表===
BindCtrl("Select *,-1 Type,'' Url from ProductDetail where Parent_Id="+Parent_Id+" and Product_Id="+Product_Id+" order by [Count] Desc","","",olst);
// Type:-1表示主栏目或者歌曲,产品推荐0, 栏目推荐为1, 铃声推荐为2, 直接连接推荐为3,为插入更多4, 插入特殊连接5, 插入图片为8
}
/// <summary>
/// 增加点击数
/// </summary>
/// <param name="Parent_id">父节点</param>
/// <param name="RingDetail_Id">铃声Id</param>
public void AddDownLoadCount(string Parent_id,string RingDetail_Id)
{
RunSql("update ProductDetail set [Count]=[Count]+1 where Parent_id="+Parent_id+" and RingDetail_Id="+RingDetail_Id);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -