软测单独项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

71 lines
2.6 KiB

using System.Web;
using System.Data;
namespace FangYar.WebUI.Handle
{
/// <summary>
/// VISGDT 的摘要说明 林芝市米林消防救援大队 根据部门编号获取人员Tree
/// </summary>
public class XZLZMLXFJYDDVIShostEmp : IHttpHandler
{
private FangYar.BLL.TBL.SysEmpBLL ebll = new FangYar.BLL.TBL.SysEmpBLL();
private FangYar.BLL.OA.TBL_EPUIP_ORG eobll = new FangYar.BLL.OA.TBL_EPUIP_ORG();
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
string returnStr = "";
returnStr = ReceiveAlarmInfoPlate(context);
context.Response.Write(returnStr);
}
//硬件接口:
//根据人证机设备编号 获取Tree 本机构下-部门-员工(获取UID)
private string ReceiveAlarmInfoPlate(HttpContext context)
{
string returnstr = "";
try
{
//string EpuId = context.Request.Params["deviceNumber"];
string hostDeptId = context.Request.Params["hostDeptId"];
if (hostDeptId != null || hostDeptId != "")
{
returnstr = "{\"code\":200,\"msg\":\"success\",\"data\":[";
DataTable data = ebll.deptIdGetEmpList(hostDeptId);
//returnstr += FangYar.Common.JsonHelper.ToJson(data);
for (int i = 0; i < data.Rows.Count; i++)
{
if (i == 0)
{
returnstr += "{\"id\": \"" + data.Rows[i]["ID"].ToString() + "\",\"label\": \"" + data.Rows[i]["LABEL"].ToString() + "\", \"value\": \"" + data.Rows[i]["VALUE"].ToString() + "\"}";
}
else
{
returnstr += ",{\"id\": \"" + data.Rows[i]["ID"].ToString() + "\",\"label\": \"" + data.Rows[i]["LABEL"].ToString() + "\", \"value\": \"" + data.Rows[i]["VALUE"].ToString() + "\"}";
}
}
returnstr += "]";
}
else
{
returnstr = "{\"code\":0,\"msg\":\"未查询到设备所属机构\",\"data\":[]}";
}
returnstr += "}";
}
catch
{
returnstr = "{\"code\":0,\"msg\":\"error\",\"count\":0,\"data\":[]}";
}
return returnstr;
}
public bool IsReusable
{
get
{
return false;
}
}
}
}