1 Star 0 Fork 32

hmfl/ELightShop

forked from Yokit/ELightShop 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
default.aspx.cs 4.78 KB
一键复制 编辑 原始数据 按行查看 历史
Yokit 提交于 2016-05-16 06:22 . First Commit
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using YduCLB.Front;
using YduCLB.SQL;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//By Yokit QQ182860914
Conn Tc = new Conn();
GList xGList = new GList();
FCtrl xFctrl = new FCtrl();
ArrayList Result = new ArrayList();
string[] aRate = xFctrl.Cvrate();
string sData = string.Empty;
string sTem = string.Empty;
double nPrice = 0;
try
{
SqlDataReader drReader = Tc.ConnDate("select id,title,small_pic,brief,static from " + TableName.db_topics + " where id=1");
if (drReader.Read())
{
sTem = "<a href=\"/promotion/\">{$0}</a>";
Ft_TopicTi.Text = sTem.Replace("{$0}", drReader["title"].ToString());
Ft_TopicPic.Text = sTem.Replace("{$0}", "<img src=\"" + drReader["small_pic"].ToString() + "\" alt=\"\" width=\"182\" height=\"125\" />");
Ft_TopicBrief.Text = drReader["brief"].ToString();
Ft_TopicLink.Text = sTem.Replace("{$0}", "Detail&gt;&gt;");
}
drReader.Close();
drReader.Dispose();
}
catch
{
}
sData = string.Empty;
Result = xGList.get_RecList(TableName.db_product, 1, 3, "is_top=1 order by relea_time desc", new string[] { "id", "static", "title", "was", "price", "small_pic" });
foreach (string[] aList in Result)
{
nPrice = Convert.ToDouble(aList[4]) / Convert.ToDouble(aRate[0]);
aList[4] = aRate[1] + Math.Round(nPrice, 2).ToString();
sData = sData + String.Format("<ul><li class=\"i1\"><a href=\"/store/{1}.html\"><img src=\"{5}\" alt=\"\" width=\"75\" height=\"75\" /></a></li><li class=\"i2\"><a href=\"/store/{1}.html\" title=\"{2}\">{2}</a><span>{4}</span></li><li class=\"mclear\"></li></ul>", aList) + "\n";
}
Ft_Tsale.Text = sData;
sData = string.Empty;
Result = xGList.get_RecList(TableName.db_product, 1, 8, "is_new=1 order by relea_time desc", new string[] { "id", "static", "title", "was", "price", "small_pic" });
foreach (string[] aList in Result)
{
nPrice = Convert.ToDouble(aList[3]) / Convert.ToDouble(aRate[0]);
aList[3] = aRate[1] + Math.Round(nPrice, 2).ToString();
nPrice = Convert.ToDouble(aList[4]) / Convert.ToDouble(aRate[0]);
aList[4] = aRate[1] + Math.Round(nPrice, 2).ToString();
sData = sData + String.Format("<ul><li class=\"i1\"><a href=\"/store/{1}.html\"><img src=\"{5}\" alt=\"\" width=\"160\" height=\"160\" /></a></li><li class=\"i2\"><a href=\"/store/{1}.html\" title=\"{2}\">{2}</a></li><li class=\"i3\">{3}</li><li class=\"i4\">{4}</li></ul>", aList) + "\n";
}
Ft_ProNew.Text = sData;
sData = string.Empty;
Result = xGList.get_RecList(TableName.db_product, 1, 8, "is_hot=1 order by relea_time desc", new string[] { "id", "static", "title", "was", "price", "small_pic" });
foreach (string[] aList in Result)
{
nPrice = Convert.ToDouble(aList[3]) / Convert.ToDouble(aRate[0]);
aList[3] = aRate[1] + Math.Round(nPrice, 2).ToString();
nPrice = Convert.ToDouble(aList[4]) / Convert.ToDouble(aRate[0]);
aList[4] = aRate[1] + Math.Round(nPrice, 2).ToString();
sData = sData + String.Format("<ul><li class=\"i1\"><a href=\"/store/{1}.html\"><img src=\"{5}\" alt=\"\" width=\"160\" height=\"160\" /></a></li><li class=\"i2\"><a href=\"/store/{1}.html\" title=\"{2}\">{2}</a></li><li class=\"i3\">{3}</li><li class=\"i4\">{4}</li></ul>", aList) + "\n";
}
Ft_ProHot.Text = sData;
Ft_PageTitle.Text = "Android Tablet PC, Global Online China Best Android Tablet PC Store, Android Tablet PC from Online Tablet PC Store";
#region
//ArrayList Result = new ArrayList();
//string sData = "";
//Result = xGList.get_RecList(TableName.db_news, 1, 7, "Sort_id=1 order by Publi_time desc", new string[] { "id", "Title", "Publi_time" });
//foreach (string[] aList in Result)
//{
// aList[1] = "获取列表方案二";
// sData = sData + String.Format("<li><a href=\"" + SiteInfo.siteurl + "infor/{0}.html\">{1}</a></li>", aList) + "\n";
//}
//Ft_News.Text = sData;
#endregion
Tc.CloseConn();
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/hmfl/ELightShop.git
git@gitee.com:hmfl/ELightShop.git
hmfl
ELightShop
ELightShop
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385