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_jybcsqjj.3.cs
?#pragma checksum "D:\wwwroot\bgsciences\wwwroot\sysmanage\files\fuwu\fuwutype.aspx.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "A152667CBA2931D1692DE0A5EC2E0C4CE97C96A9"

#line 1 "D:\wwwroot\bgsciences\wwwroot\sysmanage\files\fuwu\fuwutype.aspx.cs"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class sysmanage_files_fuwu_fuwutype : 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>");
            //}
            if (Request.Form["Option"] != null && Request.Form["Option"] != "")
            {
                int id = Convert.ToInt32(Request.Form["id"]);
                DataTable dt = SQLServerHelper.ExecuteTable("select id from TB_FuWuClass where fid = " + id);
                if (dt != null && dt.Rows.Count > 0)
                {
                    Response.Write("删除失败,此分类蕴含二级子类,请先删除二级子类");

                }
                else
                {
                    SQLServerHelper.execNonQuery("delete from TB_FuWuClass where id = " + id + "");
                    Response.Write("删除成功");
                }

                Response.End();
            }
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {

                this.txt_name.Text = SQLServerHelper.getOneVal("select sname from TB_FuWuClass where id = " + Request.QueryString["id"]);
                bt_add.Text = "编纂分类";
            }
            Bind();
            BindCount();
        }
    }
    //绑定步骤
    private void Bind()
    {
        this.InfoList.DataSource = sqltool.getData_PageFromTwoTable(this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex, " * ", "TB_FuWuClass", "fid=0", 0, "");
        this.InfoList.DataBind();
    }
    private void BindCount()
    {
        int count = sqltool.SelectCountByTCW("TB_FuWuClass", "*", "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() != "")
            {
                string strupsql = "update TB_FuWuClass set sname = '" + this.txt_name.Text.Trim() + "' where id = " + Request.QueryString["id"];
                SQLServerHelper.execNonQuery(strupsql);
            }
        }
        else
        {
            if (this.txt_name.Text.Trim() != null && this.txt_name.Text.Trim() != "")
            {
                SQLServerHelper.execNonQuery("insert into TB_FuWuClass (sname,fid) values ('" + this.txt_name.Text.Trim() + "',0)");
            }
        }

        Bind();
        BindCount();
        this.txt_name.Text = "";
    }
}

#line default
#line hidden