|
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/ |
?#pragma checksum "D:\wwwroot\bgsciences\wwwroot\sysmanage\files\about\about.aspx.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6DF89C41BF6400B73E7A97B362119D6F61D7B29D"
#line 1 "D:\wwwroot\bgsciences\wwwroot\sysmanage\files\about\about.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_about : System.Web.UI.Page
{
protected string strtitle = "";
protected void Page_Load(object sender, EventArgs e)
{
login.OnLine();
if (!IsPostBack)
{
//if (Session["UserName"] == null)
//{
// Response.Redirect("../../login.aspx");
// return;
//}
BindLGType();
if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
{
int id = int.Parse(Request.QueryString["id"]);
ViewState["id"] = id;
BindData(id);
BindType(id);
}
}
}
//绑定说话版本
protected void BindLGType()
{
DataTable dt = SQLServerHelper.ExecuteTable("select id,lg from TB_LG");
if (dt.Rows.Count > 0)
{
this.ddl_lg.DataSource = dt;
this.ddl_lg.DataTextField = "lg";
this.ddl_lg.DataValueField = "id";
this.ddl_lg.DataBind();
}
}
protected void BindType(int type)
{
DataTable dt = SQLServerHelper.ExecuteTable("select sname from TB_AboutClass where lg = 1 and id = " + type + "");
if (dt.Rows.Count > 0)
{
strtitle = dt.Rows[0]["sname"].ToString();
}
}
protected void BindData(int id)
{
DataTable dt = SQLServerHelper.ExecuteTable("select * from TB_About where types = " + id + " and lg = " + this.ddl_lg.SelectedValue.Trim() + "");
if (dt.Rows.Count > 0)
{
this.txt_name.Text = dt.Rows[0]["title"].ToString();
this.txt_content.Value = dt.Rows[0]["contents"].ToString();
}
}
protected void bt_add_Click(object sender, EventArgs e)
{
if (ViewState["id"] != null)
{
string strsql = string.Empty;
int id = int.Parse(ViewState["id"].ToString());
DataTable dt = SQLServerHelper.ExecuteTable("select * from TB_About where types = " + id + " and lg = " + this.ddl_lg.SelectedValue + "");
if (dt.Rows.Count > 0)
{
strsql = "update TB_About set title = '" + this.txt_name.Text.Trim() + "',contents = '" + this.txt_content.Value + "',lg = " + this.ddl_lg.SelectedValue + " where id = " + dt.Rows[0]["id"] + "";
}
else
{
strsql = "insert into TB_About (title,contents,types,users,lg) values ('" + this.txt_name.Text.Trim() + "','" + this.txt_content.Value + "','" + Request.QueryString["id"] + "','" + Session["username"] + "'," + this.ddl_lg.SelectedValue.Trim() + ")";
}
SQLServerHelper.execNonQuery(strsql);
}
}
protected void ddl_lg_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.ddl_lg.SelectedValue != "")
{
DataTable dt = SQLServerHelper.ExecuteTable("select * from TB_About where types = " + ViewState["id"] + " and lg = " + this.ddl_lg.SelectedValue + "");
if (dt.Rows.Count > 0)
{
this.txt_name.Text = dt.Rows[0]["title"].ToString();
this.txt_content.Value = dt.Rows[0]["contents"].ToString();
}
else
{
this.txt_name.Text = "";
this.txt_content.Value = "";
}
}
}
}
#line default
#line hidden