using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class WTOSYSadmin_Products_Paymentpattern: System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["WtoRightName"] == null)
        {
            Response.Redirect("~/SYSADMIN/main/error.aspx?err=非法登陆!或系统超时，请刷新后重新登录");
        }
                        if (!IsPostBack)
                        {
                            this.databind2();
                        }
    }
    protected void databind2()
    {
        SqlConnection conn = CDatabase.wtoconn();
        conn.Open();
        SqlDataAdapter sda = new SqlDataAdapter("select * from newsSole where id=10000040", conn);
        this.title.Text = "支付方式";
        SqlCommand smd = new SqlCommand("select * from newsSole where id=10000040", conn);
        SqlDataReader sdr = smd.ExecuteReader();
        sdr.Read();        
        this.Content.Text = Server.HtmlDecode(sdr.GetString(3));
        sdr.Close();
        conn.Close();
    }
    protected void addedit_Click(object sender, EventArgs e)
    {
        string Content1;
        Content1 = Server.HtmlEncode(this.Content.Text.Replace("'", "''"));

        string sql1 = "update newsSole set adddate='" + DateTime.Now.ToString() + "',Content='" + Content1 + "' where  id=10000040";
        if (Doadmin.Exec(sql1))
        {
            Response.Write("<script>alert('修改成功');</script>");

        }
        else
        {
            Response.Write("<script>alert('此次操作失败')</script>");
        }
    }
}
