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;

namespace JuSNS.Web.inc.Ajax
{
    public partial class MovieURL : JuSNS.UI.Page.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string ResultStr = string.Empty;
            if (this.GetUserID() == 0)
            {
                ResultStr = "请登录后操作。";
            }
            else
            {
                string Action = Request.QueryString["Action"];
                if (Action != string.Empty && Action != null)
                {
                    int MovieID = Convert.ToInt32(Request.QueryString["MovieID"]);
                    string MovieName = Request.QueryString["mName"];
                    string MovieURL = Request.QueryString["mURL"];
                    //开始分析地址中的地址


                    //增加积分
                    int isLock = 1;
                    string movieCheck = JuSNS.Common.Public.GetXMLValue("movieCheck");
                    if (movieCheck == "0")
                    {
                        isLock = 0;
                    }
                    JuSNS.Home.Movie MD = new JuSNS.Home.Movie();
                    int n = MD.InsertMovieURL(MovieID, GetUserID(), MovieName, MovieURL, isLock);
                    if (n > 0)
                    {
                        if (isLock == 1)
                        {
                            ResultStr = "添加成功，但需要管理员审核！请等待";
                        }
                        else
                        {
                            ResultStr = "添加成功";
                        }
                    }
                    else
                    {
                        ResultStr = "添加地址出错";
                    }
                    Response.Write(ResultStr);
                    Response.End();
                }
            }
        }
    }
}
