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 System.IO;

namespace JuSNS.Web.home.gift
{
    public partial class set : JuSNS.UI.Page.UserPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string userXML = "~/user/config/xml/" + UserID.ToString() + ".xml";
                string getRuslut = JuSNS.Common.Public.getXML(userXML, "isOpenGift", "0", 1);
                if (getRuslut == "1")
                {
                    this.isOpenGift.Checked = true;
                }
            }
            if (!string.IsNullOrEmpty(Request.QueryString["error"]))
            {
                this.msgsucc.Visible = true;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {

            string userXML = "~/user/config/xml/" + UserID.ToString() + ".xml";
            string getRuslut = string.Empty;
            if (this.isOpenGift.Checked)
            {
                getRuslut = JuSNS.Common.Public.getXML(userXML, "isOpenGift", "1", 2);
            }
            else
            {
                getRuslut = JuSNS.Common.Public.getXML(userXML, "isOpenGift", "0", 2);
            }
            Response.Redirect("set.aspx?error=0");
        }
    }
}
