ShowBook.aspx.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
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;
using System.IO;
using System.Data.SqlClient;
public partial class ShowBook : System.Web.UI.Page
{
SqlHelper data = new SqlHelper();
SqlConnection sqlconn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
this.Title = "茶叶销售管理系统";
if (!IsPostBack)
{
data.RunSql("update BookInfo set BookClick=BookClick+1 where BookID=" + Request.QueryString["id"].ToString());
string sql = "select * from BookInfo where BookID=" + Request.QueryString["id"].ToString();
getdata(sql);
}
}
private void getdata(string sql)
{
SqlDataReader dr = data.GetDataReader(sql);
if (dr.Read())
{
Label2.Text = dr["BookName"].ToString();
Label4.Text = dr["BookPrice"].ToString();
Label1.Text = dr["BookPrice1"].ToString();
Label5.Text = dr["BookNum"].ToString();
DIV1.InnerHtml = dr["BookIntroduce"].ToString();
Label6.Text = dr["BookClick"].ToString();
iGPhoto.ImageUrl = "files/" + dr["BookPhoto"].ToString();
Label3.Text = dr["BookTypeName"].ToString();
Hidden1.Value = dr["BookTypeID"].ToString();
}
}
protected void btnShop_Click(object sender, EventArgs e)
{
int store = Convert.ToInt32(Label5.Text);//获取库存买数量
int num = 0;
try
{
num = Convert.ToInt32(TextBox1.Text);//获得购买数量
}
catch (Exception ex)
{
Alert.Alertjs("数量格式不正确!");
return;
}
if (store < num)//判断是否大于库存数量
{
后面还有 39 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。