Manage/upmov.aspx.cs

(开头部分) 5KB

这里只显示每个文件的开头 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.Data.SqlClient;
public partial class Manage_upmov : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.databind();
            int id = Convert.ToInt32(Request.QueryString["movid"]);
            SqlConnection con = DB.getcon();
            SqlCommand cmd = new SqlCommand("select*from Movies where MovID='" + id + "'", con);
            con.Open();
            SqlDataReader dr=cmd.ExecuteReader();
            
            if(dr.Read())
            {   this.TextBox1.Text=dr["MovName"].ToString();
                this.TextBox2.Text=dr["Movdirector"].ToString();
                this.TextBox3.Text=dr["MovActor"].ToString();
                this.TextBox4.Text=dr["MovTime"].ToString();
                this.TextBox5.Text=Convert.ToDateTime(dr["MovStartData"]).ToShortDateString();
                this.TextBox6.Text=dr["MovCountry"].ToString();
                this.TextBox7.Text=dr["MovLanguage"].ToString();
                this.TextBox9.Text=dr["MovDec"].ToString();
                this.DropDownList1.SelectedValue=dr["CatID"].ToString();
            
            }
            dr.Close();
            con.Close(); 
            
        }

    }
    public void databind()
    {
        SqlConnection con = DB.getcon();
        string sqlstr = "select*from Categories";
        DataSet ds = new DataSet();
        SqlDataAdapter sda = new SqlDataAdapter(sqlstr, con);
        sda.Fill(ds, "cate");
        this.DropDownList1.DataSource = ds.Tables["cate"].DefaultView;
        this.DropDownList1.DataTextField = "CatName";
        this.DropDownList1.DataValueField = "CatID";
        DropDownList1.DataBind();     
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string mname = this.TextBox1.Text;
        string mclass = this.DropDownList1.SelectedValue.ToString();
        string director = this.TextBox2.Text;
        string actor = this.TextBox3.Text;
后面还有 69 行代码,购买后查看完整代码

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

AI 解读 AI

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

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