Web/pro_show.aspx.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using UBW.Common;

public partial class _pro_show : System.Web.UI.Page
{
    UBW.BLL.books bll = new UBW.BLL.books();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ShowInfo();
        }
    }

    //初始化
    private void ShowInfo()
    {
        if (Request.QueryString["id"] != null)
        {
            UBW.Model.books model = bll.GetModel(int.Parse(Request.QueryString["id"].ToString()));
            if (model != null)
            {
                lblbname.Text = model.bname.ToString(); ;               
                lblauthor.Text = model.author.ToString(); ;
               imgpic.ImageUrl= "/uploads/"+model.pic.ToString(); ;
                lbloprice.Text = model.oprice.ToString(); ;
                lblprice.Text = model.price.ToString(); ;
                lblmemo.Text = model.memo.ToString(); ;
                lblatime.Text = model.atime.ToString(); ;
                lbllname.Text = model.lname.ToString(); ;
                lblquan.Text = model.quan.ToString();

                if(model.quan<=0)
                {
                    Button1.Enabled = false;
                    Button1.Text = "暂无库存";
                }
            }
        }
    }



    protected void Button1_Click(object sender, EventArgs e)
    {

        //验证是否登陆
        if (Session["lname"] == null)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('请先登录后再进行此操作!');location.href='login.aspx';</script>");
            Session["url"] = Request.Url.ToString();
            return;
        }

        //验证输入是否有误
后面还有 23 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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