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 : Fm.Bussiness.BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        GetPage("");
    }
    void GetPage(string where)
    {
        FormPaging_Rep1.TableName = "Fm_singlepage";
        FormPaging_Rep1.ColName = "sid";
        FormPaging_Rep1.Where = where;
        FormPaging_Rep1.Rep = Repeater1;
        FormPaging_Rep1.Order = 1;
    }
    protected void HtmlWrite_Click(object sender, EventArgs e)
    {
        LinkButton btn = sender as LinkButton;
        Fm.Tags.SingleTags s = new Fm.Tags.SingleTags();
        if (s.Analysis_Single(int.Parse(btn.ToolTip)))
        {
            Response.Redirect("Erro.aspx?eid=单页生成成功!&url=singlepage.aspx", false);
        }
    }
    protected void DeleteBtn_Click(object sender, EventArgs e)
    {
        LinkButton btn = sender as LinkButton;
        int sid=int.Parse(btn.ToolTip);
        Fm.Bussiness.public_select ps = new Fm.Bussiness.public_select();
        string path = ps.Getps("Fm_singlepage", "spath", "sid=" + sid + "").Table.Rows[0]["spath"].ToString();
        if (ps.Queryps("delete from Fm_singlepage where sid="+sid+""))
        {
            ATL.IO.IOStream stream = new ATL.IO.IOStream();
            stream.DeleteFile(Server.MapPath(path));
            Response.Redirect("Erro.aspx?eid=单页删除成功!&url=singlepage.aspx", false);
        }
    }
}
