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 MetaType;
using MetaInfo;

public partial class admin_Meta_MetaInfoAdd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Bind();
        }
    }
    private void Bind()
    {
        IMetaType RMeta = new RMetaType();
        DataTable dt = RMeta.GetDataTable();
        dropMetaType.DataSource = dt.DefaultView;
        dropMetaType.DataValueField = "ID";
        dropMetaType.DataTextField = "Type";
        dropMetaType.DataBind();
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            TMetaInfo TMeta = new TMetaInfo();
            TMeta.TypeID = int.Parse(dropMetaType.SelectedValue);
            TMeta.Keywords = txtKeywords.Text;
            TMeta.Descriptions = txtDescriptions.Text;
            IMetaInfo RMeta = new RMetaInfo();
            RMeta.Insert(TMeta);
            Base.BasePage.ShowMessage("添加Meta信息成功！", "Meta/MetaInfoManage.aspx");
        }
        catch (Exception ex)
        {

            Base.BasePage.ShowMessage("添加Meta信息失败！", "Meta/MetaInfoManage.aspx");
        }
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        Response.Redirect("MetaInfoManage.aspx");
    }
}
