软测单独项目
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.
 
 
 
 
 
 

73 lines
2.5 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Text;
using System.Collections;
using System.Reflection;
using System.Web.Script.Serialization;
using FangYar.Model;
using FangYar.BLL;
namespace FangYar.WebUI.ashx
{
/// <summary>
/// OaLeaveHandler 的摘要说明
/// </summary>
public class FireShiftsBasicHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
// 记录操作日志
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Other, "交接班配置操作请求", "");
context.Response.ContentType = "text/plain";
string action = context.Request.Params["Action"];
string returnstr = "";
switch (action)
{
case "getListByOrgId":
returnstr = getListByOrgId(context);
break;
}
context.Response.Write(returnstr);
}
//根据机构ID查询交接班配置表
private string getListByOrgId(HttpContext context)
{
string returnstr = "";
try
{
string findOrgId = context.Request.Params["orgId"];
if (string.IsNullOrEmpty(findOrgId))
{
return "{\"code\":\"-1\",\"msg\":\"请求异常,请联系平台管理员。\",\"error\":\"orgId参数不能为空!\",\"data\":[]}";
}
string sql = @"SELECT * FROM fire_shifts_basic where org_id = '" + findOrgId + "' order by sort ";
DataTable dt = FangYar.Common.MySqlHelper.QueryTable(sql);
returnstr = "{\"code\":\"200\",\"msg\":\"操作成功!\",\"data\":";
returnstr += FangYar.Common.JsonHelper.ToJson(dt);
returnstr += "}";
}
catch (Exception e)
{
returnstr = "{\"code\":\"-1\",\"msg\":\"请求异常,请联系平台管理员!\",\"error\":\"" + e.Message + "\",\"data\":[]}";
// 记录操作日志
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "交接班配置操作请求", "根据机构ID查询交接班配置表异常:" + e);
}
return returnstr;
}
public bool IsReusable
{
get
{
return false;
}
}
}
}