using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace VRS.Handler { /// /// UserHandler 的摘要说明 /// public class UserHandler : BaseHandler, IHttpHandler { DataService.BLL.admin_user bll = new DataService.BLL.admin_user(); /* public override void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string id = context.Request.Params["id"]; if (!string.IsNullOrWhiteSpace(id)) { context.Response.Write(GetJsonWithCode(APICode.Success, bll.GetModel(id))); } else { context.Response.Write(GetJsonWithCode(APICode.Success, bll.GetModelList(""))); } } */ public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; if (null == context.Request["action"]) { var result = GetResult(false, "缺少参数:action"); context.Response.Write(result); context.Response.End(); } string action = context.Request["action"]; switch (action) { case "Add": //AddProjects(context); break; case "Update": //UpdateProjects(context); break; case "Delete": // DeleteProjects(context); break; case "Query": //QueryProjects(context); break; //按照年份查询项目 ,参数 Year:年份 case "queryByYear": //queryByYear(context); break; //按条件查询项目 参数:ProjectType:项目类型,ProjectType为空查询所有 case "queryByProjectType": //queryByProjectType(context); break; case "test": //test(context); break; default: var result = GetResult(false, "方法名不存在:" + action); context.Response.Write(result); break; } } public bool IsReusable { get { return false; } } } }