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.system.blog
{
    public partial class ajax : JuSNS.UI.Page.ManagePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.Form["Option"] != null && Request.Form["id"] != null)
                {
                    try
                    {
                        int id = int.Parse(Request.Form["id"]);
                        JuSNS.Manage.Blog bl = new JuSNS.Manage.Blog();
                        switch (Request.Form["Option"])
                        {
                            case "Lock":
                                bl.ChangeLock(UserID, id, true);
                                break;
                            case "UnLock":
                                bl.ChangeLock(UserID, id, false);
                                break;
                            case "Delete":
                                bl.Delete(UserID, id);
                                break;
                            case "Rec":
                                string t = Request.Form["ts"];
                                bl.Rec(Convert.ToInt32(t), id);
                                break;
                        }
                        Response.Write("1");
                    }
                    catch
                    {
                        Response.Write("0");
                    }
                }
                Response.End();
            }
        }
    }
}
