OrderList.aspx.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
namespace MyPetShop
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void chkAll_checkedChanged(object sender, EventArgs e)
{
//获取gridview标题行中的chkAll对象
CheckBox chkAll = (CheckBox)sender;
chkAll.Checked = true;
foreach (GridViewRow gvRow in GridView1.Rows)
{
//获取gridview数据行中chkItem对象
CheckBox chkItem = (CheckBox)gvRow.FindControl("chkItem");
chkItem.Checked = true;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
foreach (GridViewRow gvRow in GridView1.Rows)
{
CheckBox chkItem = (CheckBox)gvRow.FindControl("chkItem");
if (chkItem.Checked == true)
{
if (gvRow.Cells[12].Text == "未审核")
Page.ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('您的订单还未发货哦,亲,请耐心等待!');</script>");
else
{
DB db = new DB();
SqlConnection con = db.GetCon();//连接数据库
con.Open();//打开连接
SqlCommand cm = new SqlCommand("select Pingjia from [Order] where OrderId="+int.Parse(gvRow.Cells[1].Text),con);
SqlDataReader sd = cm.ExecuteReader();
sd.Read();
string Pingjia=sd["Pingjia"].ToString();
sd.Close();
if (Pingjia == "NULL")
{
SqlCommand cmd = new SqlCommand("select ProductId from Product where Name='" + gvRow.Cells[8].Text + "'", con);
SqlDataReader sdr = cmd.ExecuteReader();
sdr.Read();
Response.Redirect("~/PingjiaProc.aspx?ProductId=" + sdr["ProductId"].ToString() + "&OrderId=" + gvRow.Cells[1].Text);
sdr.Close();
}
else
Page.ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('您已经评价!');</script>");
}
后面还有 7 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
