shopcar.aspx.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
public partial class reg : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
if(Session["lname"]!=null)
{
chushi();
}
bind();
}
}
/// <summary>
/// 初始化
/// </summary>
protected void chushi()
{
StringBuilder strSql = new StringBuilder();
strSql.Append(@"select * from members where lname='" + Session["lname"].ToString() + "'");
//根据编号得到相应的记录
DataSet ds = SqlHelper.ExecuteforDataSet(strSql.ToString());
if (ds.Tables[0].Rows.Count > 0)
{
txt_mname.Text = ds.Tables[0].Rows[0]["mname"].ToString();
txt_tel.Text = ds.Tables[0].Rows[0]["tel"].ToString();
txt_address.Text = ds.Tables[0].Rows[0]["address"].ToString();
}
}
protected void bind()
{
ShopCart sc = (ShopCart)Session["sc"];
if(sc!=null && sc.Total>0)
{
Repeater1.DataSource = sc.Orders;
Repeater1.DataBind();
Literal1.Text = sc.TotalCounts.ToString();
float a = float.Parse(sc.TotalCounts1.ToString()) - float.Parse(sc.TotalCounts.ToString());
this.Label2.Text = a.ToString();
//float b = float.Parse(result.Tables[0].Rows[0]["TotalPrice1"].ToString()) % float.Parse(result.Tables[0].Rows[0]["TotalPrice"].ToString());
double percent = Convert.ToDouble(sc.TotalCounts.ToString()) / Convert.ToDouble(sc.TotalCounts1.ToString());
string result1 = string.Format("{0:0.00%}", percent);//得到5.88%
后面还有 116 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。