ActionLabel/Products.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Text;
using System.Data.SqlClient;using System.Data;
using Common;

namespace ActionLabel
{
    public class Products
    {
        /// <summary>
        /// 产品图片列表
        /// </summary>
        /// <param name="top">显示条数</param>
        /// <param name="txtNum">显示字符,注意一个汉字等于二个字节</param>
        /// <param name="imgW">预览图宽度</param>
        /// <param name="imgH">预览图高度</param>
        /// <param name="strWhere">查询条件</param>
        /// <param name="orderby">排序条件</param>
        /// <returns></returns>
        public static string ViewImgList(int top, int txtNum, int imgW, int imgH, string strWhere, string orderby)
        {
            BLL.Products bll = new BLL.Products();
            StringBuilder strTxt = new StringBuilder();
            DataSet ds = bll.GetList(top, strWhere, orderby);
            //如果记录存在
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds.Tables[0].Rows[i];
                    strTxt.Append("<li>");
                    strTxt.Append("<a target=\"_blank\" href=\"Product_View.aspx?id=" + dr["ID"] + "\">");
                    strTxt.Append("<img src=\"/Tools/Http_ImgLoad.ashx?w=" + imgW + "&h=" + imgH + "&gurl=" + dr["ImgUrl"] + "\" alt=\"" + dr["Title"].ToString() + "\" />");
                    strTxt.Append("</a>");
                    strTxt.Append("<span><a target=\"_blank\" title=\"" + dr["Title"].ToString() + "\" href=\"Product_View.aspx?id=" + dr["Id"] + "\">" + StringPlus.CutString(dr["Title"].ToString(), txtNum) + "</a></span>");
                    strTxt.Append("</li>\n");
                }
            }
            else
            {
                strTxt.Append("<div>暂无数据显示...</div>");
            }
            return strTxt.ToString();
        }

        /// <summary>
        /// 首页文字产品
        /// </summary>
        /// <param name="top">显示条数</param>
        /// <param name="txtNum">标题字数</param>
        /// <param name="isTime">是否显示时间</param>
        /// <param name="chrico">标题前符号</param>
        /// <param name="strWhere">查询条件</param>
        /// <param name="orderby">排序条件</param>
        /// <returns></returns>
        public static string ViewTxtList(int top, int txtNum, int isTime, string chrico, string strWhere, string orderby)
        {
            BLL.Products bll = new BLL.Products();
            StringBuilder strTxt = new StringBuilder();
            DataSet ds = bll.GetList(top, strWhere, orderby);
后面还有 142 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。