using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Models;
using LoveBLL;

namespace LoveWeb
{
    public partial class Review : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           
                if (Session["username"] != null)
                {
                    Label1.Text = Session["username"].ToString();
                    if (Session["revi_id"] != null)
                    {
                        int id = (int)Session["revi_id"];
                        Session["revi_id"] = id;
                    }
                  
                }        
                //btnInviTitle.Text = "";
                //FCK_invi.Value = "";
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
          
            if (Label1.Text != "")
            {
               
                Invitation invi = new Invitation();
                invi.Invi_title = btnInviTitle.Text;
                invi.Invi_contents = FCK_invi.Value;
                invi.Invi_time = System.DateTime.Now;
                invi.Userid = UserManager.GetIdByUsername(Label1.Text).Userid;
                invi.Invi_click = 1;
                InvitationManager.AddInvi(invi);
                Response.Redirect("~/Forum.aspx");
            }
            else
            {
                Session["sort"] = "Forum_Add";
                Response.Write("<script>alert('请先登录！')</script>");
                Response.Redirect("~/Login/Login.aspx");
            }
        }

        protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/Forum.aspx");
        }
    }
}
