jbxx/updatamdgl.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;
using System.Data;

public partial class updatamdgl : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["username"] == null)
            {
                Response.Clear();
                Response.Write("<script language='javascript'>window.top.location.href='../login.aspx'</script>");
                Response.End();
            }
            else
            {
                bing(); ddlbind();
            }
        }
    }
    protected void ddlbind()
    {
        string sql = "select j_dmdjid,j_dmdjno,j_dmdjname from j_dmdj";
        DataTable dt = SQLHelper.ExecteTable(sql, new SqlParameter("", ""));
        DropDownList1.DataSource = dt;
        this.DropDownList1.DataTextField = "j_dmdjname";
        this.DropDownList1.DataValueField = "j_dmdjno";
        this.DropDownList1.DataBind();
        this.DropDownList1.Items.Insert(0, new ListItem("-请选择-", "-1"));
    }
    private void bing()
    {
        int id = Convert.ToInt32(Request.QueryString["jq_mdid"]);
        string sqlstr = "select jq_mdname,jq_dmdj,jq_mdbz from jq_mdgl where jq_mdid=@jq_mdid";
        DataTable dt=SQLHelper.ExecteTable(sqlstr,new SqlParameter("@jq_mdid",id));
        this.tb_mdmc.Text=dt.Rows[0][0].ToString();
        this.DropDownList1.SelectedValue = dt.Rows[0][1].ToString();
        this.FCKeditor1.Value=dt.Rows[0][2].ToString();
    }
    protected void btn_save_Click(object sender, EventArgs e)
    {
        if (this.tb_mdmc.Text.Trim() == "")
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('内容不能为空 !');", true);
        }
        else if (this.DropDownList1.SelectedValue == "-1")
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请选择店面等级 !');", true);
        }
        else
        {
            int id = Convert.ToInt32(Request.QueryString["jq_mdid"]);
            string sqlstr = "update jq_mdgl set jq_mdname=@jq_mdname,jq_dmdj=@jq_dmdj,jq_mdbz=@jq_mdbz where jq_mdid=@jq_mdid";
后面还有 20 行代码,购买后查看完整代码

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

AI 解读

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

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