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.mood
{
    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.MiniBlog mnbl = new JuSNS.Manage.MiniBlog();
                        switch (Request.Form["Option"])
                        {
                            case "Lock":
                                mnbl.ChangeLock(UserID, id, true);
                                break;
                            case "UnLock":
                                mnbl.ChangeLock(UserID, id, false);
                                break;
                            case "Delete":
                                mnbl.Delete(UserID, id);
                                break;
                        }
                        Response.Write("1");
                    }
                    catch
                    {
                        Response.Write("0");
                    }
                }
                Response.End();
            }
        }
    }
}
