//by JuSNS v1.0系列
//官方站：www.juSNS.com，演示站:www.ju001.com，www.julala.cn
//QQ:655071(技术)，QQ:9170617（客服）
//MSN:simplt@163.com EMail:simplt@163.com
//program design by Simplt.Xie，arjun
//========================================

using System;
using System.Data;
using System.Text;
using System.Collections;
using System.Configuration;
using System.Collections.Generic;
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 JuSNS.Common;
using JuSNS.Home;
using JuSNS.Model;
using JuSNS.Config;

namespace JuSNS.Web.user.Album
{
    public partial class PhotoCommentAdd : JuSNS.UI.Page.UserPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Form.Count > 0)
            {
                saveComment();
            }
        }


        protected void saveComment()
        {
            PhotoCommentInfo pci = new PhotoCommentInfo();
            pci.IsLock = EnumIsLock.UnLock;
            pci.PhotoID = Convert.ToInt32(Input.Filter(Request.QueryString["r"]));
            pci.PostIP = Public.GetClientIP();
            pci.PostTime = DateTime.Now;
            pci.UserID = this.UserID;
            pci.Content = Input.Filter(Request.Form["body"]);

            PhotoComment pc = new PhotoComment();
            pc.Add(pci,UserID);
            Response.Redirect("Photoview.aspx?r[0]=" + pci.PhotoID);
        }
    }
}
