918博天堂

Server : Microsoft-IIS/10.0
System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586
User : jxgj ( 0)
PHP Version : 7.0.33
Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server
Directory :  D:/tmp_aspnet/root/712bd9e6/ca967f19/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : D:/tmp_aspnet/root/712bd9e6/ca967f19/App_Web_myahgfwl.1.cs
?#pragma checksum "D:\wwwroot\bgsciences\wwwroot\sysmanage\files\about\aboutclass.aspx.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "084249056CE3D433307C8F5A6E4B3E24F1BB7CB3"

#line 1 "D:\wwwroot\bgsciences\wwwroot\sysmanage\files\about\aboutclass.aspx.cs"
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class sysmanage_files_about_aboutclass : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        login.OnLine();

        if (!IsPostBack)
        {
            //if (Session["UserName"] == null)
            //{
            //    Page.Response.Write("<script language='javascript'> top.window.location = '../../login.aspx' </script>");
            //    return;
            //}
            if (Request.Form["Option"] != null && Request.Form["Option"] != "")
            {
                int id = Convert.ToInt32(Request.Form["id"]);

                SQLServerHelper.execNonQuery("delete from TB_AboutClass where id = " + id + "");
                Response.Write("删除成功");
                Response.End();
            }
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                int id = int.Parse(Request.QueryString["id"]);
                DataTable dt = SQLServerHelper.ExecuteTable("select sname,lg from TB_AboutClass where id = " + id + "");
                if (dt.Rows.Count > 0)
                {
                    this.txt_name.Text = dt.Rows[0]["sname"].ToString();
                    this.txt_lg.Text = dt.Rows[0]["lg"].ToString();
                }
                this.bt_add.Text = "编纂类别";
            }
            Bind();
            BindCount();
        }
    }
    //绑定步骤
    private void Bind()
    {
        this.InfoList.DataSource = sqltool.getData_PageFromTwoTable(this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex, " *,case lg when 1 then '中文' when 2 then '英文' when 3 then '日文' end as lgs ", "TB_AboutClass", "fid <> 0", 0, "");
        this.InfoList.DataBind();
    }
    private void BindCount()
    {
        int count = sqltool.SelectCountByTCW("TB_AboutClass", "*", "fid <> 0");
        this.AspNetPager1.RecordCount = count;
    }
    //分页事务
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        Bind();
    }

    protected void bt_add_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
        {
            if (this.txt_name.Text.Trim() != null && this.txt_name.Text.Trim() != "")
            {
                SQLServerHelper.execNonQuery("update TB_AboutClass set sname = '" + this.txt_name.Text.Trim() + "',lg = '" + this.txt_lg.Text.Trim() + "' where id = " + Request.QueryString["id"] + "");
            }
            
        }
        else
        {
            
            {
                SQLServerHelper.execNonQuery("insert into TB_AboutClass (sname,fid,lg) values ('" + this.txt_name.Text.Trim() + "','1','" + this.txt_lg.Text.Trim() + "')");
            }
        }
        Response.Redirect("aboutclass.aspx"); 
        Bind();
        BindCount();
    }
}


#line default
#line hidden