MyLesson/ServiceUser/Advertise_Edits.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

namespace MyLesson.ServiceUser
{
    public partial class Advertise_Edits : UserForm
    {
        SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["PersonResourceConnectionString"].ConnectionString);
        protected void Page_Load(object sender, EventArgs e)
        {
            this.ValidateLogin();
            if (!this.IsPostBack)
            {
                this.hidAdvertiseID.Value = Request.QueryString["id"] + "";
                this.txtEditTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
                this.InitList();
                this.InitForm();
            }
        }

        public void InitList()
        {


        }

        public void InitForm()
        {
            PRDataContext pr = new PRDataContext();
            if (this.hidAdvertiseID.Value != "")
            {
                conn.Open();
                SqlDataAdapter sdr = new SqlDataAdapter("select * from news where id=" + this.hidAdvertiseID.Value, conn);
                conn.Close();
                DataSet ds = new DataSet();
                sdr.Fill(ds);
                txtJobName.Text=ds.Tables[0].Rows[0]["title"].ToString();
                txtEditTime.Text = ds.Tables[0].Rows[0]["addtime"].ToString();
                txtContent.Text=ds.Tables[0].Rows[0]["content"].ToString();
                conn.Close();
        
            }
        }

        protected void btnReturn_Click(object sender, EventArgs e)
        {
            Response.Redirect("Advertise_Lists.aspx");
        }

        protected void btnOK_Click(object sender, EventArgs e)
        {

            if (this.hidAdvertiseID.Value != "")
后面还有 28 行代码,购买后查看完整代码

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

AI 解读 AI

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

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