gyhlw_dotnet/网站项目/VRS/Handler/UserHandler.ashx.cs

88 lines
2.5 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace VRS.Handler
{
/// <summary>
/// UserHandler 的摘要说明
/// </summary>
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;
}
}
}
}