using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using OAServiceBLLBase;
using Ynhosp.Portal.BLL;
using Ynhosp.Portal.BLL.DTO;
namespace Ynhosp.Portal.Web.Portal.ashx
{
/// <summary>
/// $codebehindclassname$ 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class QueryEmergencyDep : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
bool success = false;
//int limit = Int32.Parse(context.Request.QueryString["limit"].ToString().Trim());
//int offset = Int32.Parse(context.Request.QueryString["offset"].ToString().Trim());
int limit = 100;
int offset = 0;
IList<DTODutyPerson> outDatas = new List<DTODutyPerson>();
context.Response.ContentType = "text/plain";
try
{
DateTime date = DateTime.Parse(context.Request.QueryString["date"].ToString().Trim());
QueryEmergencyDepService core = new QueryEmergencyDepService();
var lstRes = new List<DTODutyPerson>();
success = core.Query(date, out outDatas);
var total = outDatas.Count;
var rows = outDatas.Skip(offset).Take(limit).ToList();
string output = JsonConvert.SerializeObject(new { total = total, rows = rows }, Newtonsoft.Json.Formatting.Indented);
HttpContext.Current.Response.Write(output);
}
catch (Exception e)
{
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
参数传递
最新推荐文章于 2021-05-16 16:45:50 发布