System/Sys_Position_Edit.aspx.cs

(完整代码) 1KB

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 System_Sys_Pro_Cls_Edit : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Get_Data();
        }
    }
    protected void Button1_Click(object sender, EventArgs e)//编辑父类类别名称
    {
        if (DB.isExists("select * from X_Position where X_Position_Name='" + txt_cls_parent.Text.Trim() + "'"))
        {
            DB.ExecuteSql("update [X_Position] set X_Position_Add=" + Convert.ToDecimal(txt_jin.Text.Trim()) + " where X_Position_ID=" + Convert.ToInt32(Request.QueryString["NId"]));
            Common.ShowMessage(Page, "更新成功!", "");
        }
        else
        {
            DB.ExecuteSql("update [X_Position] set X_Position_Name='" + Common.UrnHtml(txt_cls_parent.Text) + "',X_Position_Add="+Convert.ToDecimal(txt_jin.Text.Trim())+" where X_Position_ID=" + Convert.ToInt32(Request.QueryString["NId"]));
            Common.ShowMessage(Page, "更新成功!", "");
        }
    }
   

    void Get_Data()
    {
        SqlDataReader dr = DB.getDataReader("select * from [X_Position] where X_Position_ID=" + Convert.ToInt32(Request.QueryString["NId"]));
        if (dr.Read())
        {
            //int i=Int32.Parse(dr["X_Position_Add"].ToString());
            this.txt_cls_parent.Text = dr["X_Position_Name"].ToString();
            txt_jin.Text = dr["X_Position_Add"].ToString().Replace(".0000","");
            dr.Close();
            dr.Dispose();
        }
        else
        {
            dr.Close();
            dr.Dispose();
            this.Button1.Enabled = false;
        }
    }
}

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

AI 解读 AI

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

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