nethoutai/GroupManage.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 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;
using DBUtility;
using CommonLib;
public partial class GroupManage1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {



            SqlHelper.BindGridview(GridView1, SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, "select * from T_Group ", null);
        }
    }
    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
       
        string groupname, PurviewList, ID;

        SqlHelper.BindGridview(GridView1, SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, "select * from T_Group", null);
        groupname = ((Label)GridView1.Rows[e.NewEditIndex].Cells[1].FindControl("Label6")).Text;
        PurviewList = ((Label)GridView1.Rows[e.NewEditIndex].Cells[2].FindControl("Label3")).Text;
        ID = ((Label)GridView1.Rows[e.NewEditIndex].Cells[0].FindControl("Label4")).Text;
        HiddenField1.Value = ID;
        TextBox1.Text = groupname;
        TextBox2.Text = PurviewList;
        Button1.Text = "保存";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Button1.Text == "添加")
        {
            string groupname, PurviewList;
            groupname = TextBox1.Text;
            PurviewList = TextBox2.Text;
            SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction);

            conn.Open();
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = conn;
            cmd.CommandText = "insert into T_Group(GroupName,PurviewList)values('" +groupname + "','" + PurviewList + "')";
            int i = cmd.ExecuteNonQuery();

            if (i > 0)
            {
                JavaScriptHelper.Alert("添加成功!");
                TextBox1.Text = "";
                TextBox2.Text = "";
            }
后面还有 57 行代码,购买后查看完整代码

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

AI 解读 AI

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

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