|
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/54f3ceba/6be944cd/ |
?#pragma checksum "D:\wwwroot\klbttc\wwwroot\guestbook.aspx.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "81D157063EA059122136B15F926065DBE6A57777"
#line 1 "D:\wwwroot\klbttc\wwwroot\guestbook.aspx.cs"
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class guestbook : System.Web.UI.Page
{
C c = new C();
DataSet ds = new DataSet();
public int mid = 63;
public int menuid, firstmid = 0;
public string webSite, webSite1, layer, zzjg = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
var reqParam = Request.QueryString;
foreach (var item in reqParam.AllKeys)
{
if (item == "mid")
{
var midStr = Request.QueryString["mid"].ToString();
var isTrySuccess = int.TryParse(midStr, out mid);
if (!isTrySuccess)
{
Response.Redirect("/");
}
}
if (item == "action" && Request.QueryString["action"].ToString() == "add")
{
AddMsg();
}
}
ds = MyFunction.Query("SELECT MenuSys_1.MenuSys1 AS Expr1, MenuSys.*,MenuSys_1.MenuSys0 AS Expr3 FROM MenuSys INNER JOIN MenuSys MenuSys_1 ON MenuSys.MenuSys3 = MenuSys_1.MenuSys0 WHERE (MenuSys.MenuSys0 =@mid)", new SqlParameter[] { new SqlParameter("@mid", mid) });
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
webSite = ds.Tables[0].Rows[0]["MenuSys1"].ToString();
menuid = int.Parse(ds.Tables[0].Rows[0][4].ToString());
webSite1 = ds.Tables[0].Rows[0]["Expr1"].ToString();
}
}
string sql = "select * from about where about5=@mid;";
SqlParameter[] ps = new SqlParameter[] { new SqlParameter("@mid", 63) };
ds = MyFunction.Query(sql, ps);
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
this.Rep_Contact_63.DataSource = ds.Tables[0];
this.Rep_Contact_63.DataBind();
}
}
this.Title = webSite + " - " + Application["sysset1"].ToString();
}
private void AddMsg()
{
string channeId = SqlKey.ReplaceUrlBadChar(Request.Form["channeId"]);
string name = SqlKey.ReplaceUrlBadChar(Request.Form["name"]);
string tel = SqlKey.ReplaceUrlBadChar(Request.Form["tel"]);
string content = SqlKey.ReplaceUrlBadChar(Request.Form["content"]);
StringBuilder insertSQL = new StringBuilder(1000);
insertSQL.Append("insert into guestbook (guestbook1,guestbook2,guestbook4,guestbook5,guestbook7)");
insertSQL.Append(" values(@name,@tel,@times,@content,@mid)");
var retStatus = MyFunction.ExecuteSql(insertSQL.ToString(), new SqlParameter[]
{
new SqlParameter("@name",name),
new SqlParameter("@tel",tel),
new SqlParameter("@times",DateTime.Now),
new SqlParameter("@content",content),
new SqlParameter("@mid",channeId),
}) > 0;
if (retStatus)
{
layer = "<script>layer.confirm('留言提交成功,请期待回应!', { btn:['确定']}, function() { window.location.href = '/guestbook.aspx'; });</script>";
}
else
{
layer = "<script>layer.confirm('信息提交失败!', { btn:['确定']}, function() { window.location.href = '/guestbook.aspx'; });</script>";
}
}
}
#line default
#line hidden