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.Reflection;
using JuSNS.ApiInterface;
namespace JuSNS.Web.app.ajax
{
    public partial class ajax : JuSNS.UI.Page.UserPage
    {
        string action = string.Empty;
        string param = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            string fn = Request.Form["action"];

            string param = Request.Form["param"];

            object[] args = string.IsNullOrEmpty(param) ? null : param.Split('|');

            MethodInfo methodInfo;

            methodInfo = this.GetType().GetMethod(fn, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.IgnoreCase);

            methodInfo.Invoke(this, args);
        }
        /// <summary>
        /// 删除应用
        /// </summary>
        /// <param name="appid"></param>
        protected void deleteApp(string appid)
        {
            int n = UtilUser.DeleteApp(this.UserID, int.Parse(appid));
            Response.Write(n);
        }
        /// <summary>
        /// 添加应用
        /// </summary>
        /// <param name="appid"></param>
        protected void AddApp(string appid)
        {
            int n = UtilUser.AddApp(this.UserID, int.Parse(appid));
            Response.Write(n);
        }
    }
}
