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 Base;
using Corporation.Link;

public partial class member_Link_LinkAdd : nspBase.MemberBasePge
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!CheckCookies())
        {
            Response.Redirect("../../login/login.aspx");
            return;
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            TLink TLink = new TLink();
            int userid = int.Parse(GetCookie("UserID").ToString());
            TLink.UserID = userid;
            TLink.Name = txtName.Text.Trim();
            TLink.Url = txtUrl.Text;
            TLink.Logo = ProcessImageUrl(ImgUrl1.Value);
            ILink RLink = new RLink();
            RLink.Insert(TLink);
            ShowMessage("友情链接添加成功！", "Link/LinkList.aspx");
        }
        catch (Exception ex)
        {
            ShowMessage("在提交友情链接信息时发生错误，请重新发送", "Link/LinkAdd.aspx");
        }
    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        Response.Write("<script language=javascript>window.location.href='LinkList.aspx'</script>");
    }
}
