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 JuSNS.Model;

namespace JuSNS.Web.inc.Ajax
{
    public partial class shareweb : JuSNS.UI.Page.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetUserID() > 0)
            {

                GetIsNotEmail();
                string r = Request.QueryString["r"];
                if (r == "save")
                {

                    string mContent = Request.QueryString["content"];
                    string urls = Request.QueryString["urls"];
                    string sharetitle = Request.QueryString["sharetitle"];
                    ShareInfo info = new ShareInfo();
                    JuSNS.Home.Share shareBill = new JuSNS.Home.Share();
                    info.UserID = GetUserID();
                    info.Title = sharetitle;
                    info.Description = mContent;
                    if (urls.Substring(0, 7) != "http://")
                    {
                        urls = "http://" + urls;
                    }
                    info.Url = urls;
                    info.ShareType = EnumShareType.ShareWeb;
                    info.CaseID = 0;
                    info.IsLock = 0;
                    info.PostTime = DateTime.Now;
                    info.PostIP = JuSNS.Common.Public.GetClientIP();
                    info.Comments = 0;
                    info.Privacy = EnumPrivacy.ForWholeSite;
                    //分享到自己空间
                    info.FriendIDGroup = 0;
                    shareBill.Add(info);
                    Response.Write("success");
                    Response.End();
                }
                else
                {
                    this.sharetitles.Text = Request.QueryString["title"];
                    this.shareurls.Text = Request.QueryString["url"];
                    this.shareTXTContent.Text = Request.QueryString["desc"];
                }
            }
            else
            {
                Response.Write("<div class=\"spline\"></div><span class=\"font14\">请登录后进行操作！</a><div class=\"spline\"></div>");
                Response.End();
            }

        }
    }
}