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;

public partial class admin_singlepage_edit : Fm.Bussiness.BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int sid = 0;
            if (Request.QueryString["sid"] != null)
            {
                sid = int.Parse(Request.QueryString["sid"].ToString());
            }
            Fm.Bussiness.public_select ps = new Fm.Bussiness.public_select();
            DataView dv = ps.Getps("Fm_singlepage","*","sid="+sid+"");
            stitle.Text = dv[0]["stitle"].ToString();
            skeywords.Text = dv[0]["skeywords"].ToString();
            sintro.Text = dv[0]["sintro"].ToString();
            stemplates.Text = dv[0]["stemplates"].ToString();
            spath.Text = dv[0]["spath"].ToString();
            FCKeditor1.Value = dv[0]["scontent"].ToString();
        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        Fm.EntityClass.singlepage sp = new Fm.EntityClass.singlepage();
        sp.sid = int.Parse(Request.QueryString["sid"].ToString());
        sp.stitle = stitle.Text;
        sp.skeywords = skeywords.Text;
        sp.sintro = sintro.Text;
        sp.stemplates = stemplates.Text;
        sp.spath = spath.Text;
        sp.scontent = FCKeditor1.Value;

        Fm.Bussiness.singlepage sing = new Fm.Bussiness.singlepage();
        if (sing.Update(sp))
        {
            Response.Redirect("Erro.aspx?eid=单页修改成功!&url=singlepage.aspx", false);
        }
    }
}
