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 Fm.Bussiness;

public partial class Admin_sys_affiche_add : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["u_name"] != null)
            {
                aff_user.Text = Session["u_name"].ToString(); 
            }
        }
    }
    //公告的添加
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        sys_affiche sys = new sys_affiche();
        Fm.EntityClass.Affiche affiche = new Fm.EntityClass.Affiche();
        affiche.aff_user = aff_user.Text;
        affiche.aff_title = aff_title.Text;
        affiche.aff_content = aff_content.Value;
        affiche.aff_btime = DateTime.Now;
        affiche.aff_look = 0;
        if (sys.Affiche_Add(affiche))
        {
            Response.Redirect("Erro.aspx?eid=网站新公告信息添加成功!&url=sys_affiche_list.aspx", true);
        }
        else
        {
            Response.Redirect("Erro.aspx?eid=网站新公告信息添加失败!&url="+Request.Url.AbsoluteUri, true);
        }
        
    }
}
