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.home.Group
{
    public partial class _out : JuSNS.UI.Page.UserPage
    {
        protected JuSNS.Model.UserGroupInfo usergroupinfo;
        JuSNS.Home.GroupMember groupmember = new JuSNS.Home.GroupMember();
        protected void Page_Load(object sender, EventArgs e)
        {

            int n = 0;
            string s_gid = Request.QueryString["GroupID"];
            if (!JuSNS.Common.Input.IsInteger(s_gid))
            {
                PageError("²ÎÊý´«µÝ´íÎó!", "" + rooDir + "/home/group");
            }
            int groupid = Convert.ToInt32(s_gid);
            JuSNS.Home.UserGroup usergroup = new JuSNS.Home.UserGroup();
            usergroupinfo = usergroup.Info(groupid);
            if (usergroupinfo.UserID == UserID)
            {
                n = usergroup.Del(groupid, UserID);
            }
            else
            {
                n = groupmember.Out(UserID, groupid);
            }
            if (n>0)
            {
                Response.Cookies["OutGroup"].Value = "true";
            }
            Response.Redirect("my.aspx?r=" + UserID + "&a=join");
        }
    }
}
