admin/dd_lists.aspx.cs

(完整代码) 1KB

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Globalization;
using System.IO;
using Microsoft.Win32;
using System.Web.Security;
using System.Web.UI;
using System.Diagnostics;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class shop_list : System.Web.UI.Page
{
   // string strsql;
    DataSet ds = new DataSet();
    db DB = new db();
    protected void Page_Load(object sender, EventArgs e)
    {

            if (!IsPostBack)
            {
               
                DateTime dt = DateTime.Now;
                int id =Convert.ToInt32( Request.QueryString["id"].ToString());
                ds=DB.mydata("SELECT * FROM orders WHERE oid=" + id);
                this.Repeater1.DataSource = ds.Tables[0].DefaultView;
                this.Repeater1.DataBind();
                //将BIT的发货状态转换成bool型,再转成string型
                 bool i=Convert.ToBoolean(ds.Tables[0].Rows[0]["fahuo"].ToString());
                 this.DropDownList1.SelectedValue = Convert.ToInt32(i).ToString();
                string ems = ds.Tables[0].Rows[0]["songhuodh"].ToString();
                DataSet ds1 = DB.mydata("SELECT * FROM orders WHERE oid='" + id + "'");
                this.TextBox1.Text = ds1.Tables[0].Rows[0]["songhuodh"].ToString();
            }

    }



    protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
    {
        int id =Convert.ToInt32( Request.QueryString["id"].ToString());
        string a1 = this.TextBox1.Text.ToString();
        string a2 =this.DropDownList1.SelectedValue;

        DB.UpdateDataBySql("UPDATE orders SET fahuo=" + a2 + ",songhuodh='" + a1 + "' WHERE oid=" + id);
        Response.Write("<script>alert('修改成功!');</script>");

    }
}

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

AI 解读

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

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