⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.aspx.cs

📁 一个很好的网上购物系统!进行了新的修改具有很多的功能!
💻 CS
字号:
using System;
using System.Data;
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;

public partial class Search : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //read in the category name from the head
        
        if (Request.QueryString["q"] != null) {
            lblTitle.Text = "搜索 '" + Request.QueryString["q"].ToString()+"'";
        }
    }
    protected string GetThumb(object sImage) {
        string imageName = sImage.ToString();
        string sType = System.IO.Path.GetExtension(imageName);
        string sThumb = sType.Replace(".", "_thumb.");
        imageName = imageName.Replace(sType, sThumb);
        return imageName;
    }
    protected string GetPrice(object sUnitCost,object sDiscountPercent) {
        string sPrice = sUnitCost.ToString();
        string sDiscount = sDiscountPercent.ToString();
        double dOriginalPrice=Convert.ToDouble(sPrice);
        double dDiscountPrice = 0;
        string sOut = "";

        int discountPercent = int.Parse(sDiscount);

        if (discountPercent > 0) {
            dDiscountPrice = CatalogManager.GetDiscountedPrice(dOriginalPrice, discountPercent);
            sOut = "<span class=oldprice>" + dOriginalPrice.ToString("c") + "</span>&nbsp;<span class=saleprice>" + dDiscountPrice.ToString("c") + "</span>";
        } else {
            sOut = dOriginalPrice.ToString("c");

        }

        return sOut;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -