WEB/ascx/favorite.ascx.cs

(开头部分) 3KB

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

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using shop.Model;
using shop.BLL;
namespace web
{
    public partial class favorite : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                rProductList_load();
            }
        }
        private void rProductList_load()
        {
            HttpCookie userName = Request.Cookies[Cookie.UserNameCookieName];
            if (userName != null && !string.IsNullOrEmpty(userName.Value))
            {
                Member member = new MemberBusiness().GetEntityByUserName(userName.Value);

                string fieldList = "Id,product_id,product_name,sale_price,price,create_date";
                DataRecordTable table = new FavoriteBusiness().GetList(fieldList, "create_date", true, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, "member_id=" + member.Id);
                rProductList.DataSource = table.Table;
                rProductList.DataBind();
                AspNetPager1.RecordCount = table.RecordCount;
            }
        }
        protected ProductImage GetImage(int productId)
        {
            string where = "product_id=" + productId + " and type=1";
            string fieldList = "Id,product_id,image,alt";
            string orderFiled = "Id";
            bool orderby = false;
            DataRecordTable table = new ProductImageBusiness().GetList(fieldList, orderFiled, orderby, 1, 1, where);
            ProductImage productImage = new ProductImage();
            if (table.Table.Rows.Count > 0)
            {
                productImage.Image = table.Table.Rows[0]["image"].ToString();
                productImage.Alt = table.Table.Rows[0]["alt"].ToString();
            }
            return productImage;
        }
        protected void AspNetPager2_PageChanged(object sender, EventArgs e)
        {
            rProductList_load();
        }
        protected void rProductList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
后面还有 28 行代码,购买后查看完整代码

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

AI 解读 AI

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

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