<%@ Page Language="C#" ContentType="text/html" Inherits="Ycbw.Data.OleDbClient" %>

<%@ Register TagPrefix="Rajah" TagName="Head" src="../ctrls/head.ascx" %>
<%@ Register TagPrefix="Rajah" TagName="Foot" src="../ctrls/foot.ascx" %>

<script language="c#" runat="server">
private void Page_Load(object sender, EventArgs e)
{
	if( !Page.IsPostBack )
	{
		this.Initialize();
	}
}

private void Initialize()
{
	this.Fill("Select top 1 * from [b_config]", "config");

	System.Data.DataRow dr = Tables[0].Rows[0];

	this.title.Text 	  = dr["title"].ToString();
	this.keywords.Text    = dr["keywords"].ToString();
	this.description.Text = dr["description"].ToString();
	this.address.Text     = dr["address"].ToString();
	this.tel.Text   	  = dr["tel"].ToString();
	this.fax.Text   	  = dr["fax"].ToString();
	this.email.Text   	  = dr["email"].ToString();
	this.icp.Text   	  = dr["icp"].ToString();
}

private void button_submit_click(object sender, EventArgs e)
{
	this.Fill("Select top 1 * from [b_config]", "config" );

	System.Data.DataRow dr = Tables[0].Rows[0];

	dr["title"]		  = this.title.Text;
	dr["keywords"] 	  = this.keywords.Text;
	dr["description"] = this.description.Text;
	dr["address"]	  = this.address.Text;
	dr["tel"]		  = this.tel.Text;
	dr["fax"]		  = this.fax.Text;
	dr["email"]		  = this.email.Text;
	dr["icp"]		  = this.icp.Text;

	this.Update("config");
	
	this.JWrite( "alert('修改成功');window.location.href = './config.aspx';" );
}
</script>

<Rajah:Head ID="Head" Level="0" Runat="Server" />
<form id="form1" runat="server">
<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="title3"><div style="float:left">基本信息设置</div>
      <div style="float:right"></div></td>
  </tr>
  <tr>
    <td style="padding:8px"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td class="table3"><asp:Button Text=" 提交 " OnClick="button_submit_click" runat="server" /></td>
        </tr>
        <tr>
          <td bgcolor="#EFF5FB">
		  <table width="100%" border="0" cellpadding="0" cellspacing="8">
              <tr>
                <td width="80" align="right">网站标题</td>
                <td><asp:TextBox ID="title" CssClass="text2" runat="server" Width="400" /></td>
                <td align="right">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="right">关键词</td>
                <td><asp:TextBox ID="keywords" CssClass="text2" runat="server" Width="400" /></td>
                <td align="right">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="right">描述</td>
                <td><asp:TextBox ID="description" CssClass="text2" TextMode="MultiLine" runat="server" Width="400" Height="80" /></td>
                <td align="right">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="right">地址</td>
                <td><asp:TextBox ID="address" CssClass="text2" runat="server" Width="400" /></td>
                <td align="right">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="right">电话</td>
                <td><asp:TextBox ID="tel" CssClass="text2" runat="server" Width="120" /></td>
                <td align="right">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="right">传真</td>
                <td><asp:TextBox ID="fax" CssClass="text2" runat="server" Width="120" /></td>
                <td align="right">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
               <tr>
                <td align="right">邮箱</td>
                <td><asp:TextBox ID="email" CssClass="text2" runat="server" Width="120" /></td>
                <td align="right">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
               <tr>
                <td align="right">备案信息</td>
                <td><asp:TextBox ID="icp" CssClass="text2" runat="server" Width="120" /></td>
                <td align="right">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td class="table3"><asp:Button Text=" 提交 " OnClick="button_submit_click" runat="server" /></td>
        </tr>
      </table></td>
  </tr>
</table>
</form>
<Rajah:Foot ID="Foot" Runat="Server" />
