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.dev.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="id"></param>
        protected void deleteApp(string userid,string id)
        {
            int iid=0;
            int uid = 0;
            if (!int.TryParse(id, out iid))
            {
                Response.Write(0);
                return;
            }
            if (!int.TryParse(userid, out uid))
            {
                Response.Write(0);
                return;
            }
            
            int n = Developer.DeleteApp(uid, iid);
            Response.Write(n);
        }
    }
}
