58 lines
2.0 KiB
C#
58 lines
2.0 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Web;
|
||
|
||
namespace VRS.Handler.ZHC
|
||
{
|
||
/// <summary>
|
||
/// Task_Proc_Material_Get 的摘要说明
|
||
/// </summary>
|
||
public class Task_Proc_Material_Get : BasePage, IHttpHandler
|
||
{
|
||
|
||
DataService.BLL.zhc_task bll_task = new DataService.BLL.zhc_task();
|
||
DataService.BLL.zhc_task_proc bll_task_proc = new DataService.BLL.zhc_task_proc();
|
||
DataService.BLL.zhc_task_material bll_task_material = new DataService.BLL.zhc_task_material();
|
||
DataService.BLL.zhc_task_proc_material bll_task_proc_material = new DataService.BLL.zhc_task_proc_material();
|
||
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
|
||
|
||
|
||
public override void ProcessRequest(HttpContext context)
|
||
{
|
||
context.Response.ContentType = "text/plain";
|
||
string proc_id = context.Request.Params["proc_id"];
|
||
if (string.IsNullOrEmpty(proc_id))
|
||
{
|
||
context.Response.Write(GetJsonWithCode(APICode.Fail, "参数proc_id不能为空!"));
|
||
context.Response.End();
|
||
}
|
||
var proc_model = bll_task_proc.GetModel(proc_id);
|
||
if (null == proc_model)
|
||
{
|
||
context.Response.Write(GetJsonWithCode(APICode.Fail, "步骤不存在!,参数proc_id:" + proc_id));
|
||
context.Response.End();
|
||
}
|
||
var proc_list = bll_task_proc_material.GetModelList(string.Format("proc_id= '{0}' ", proc_id)).OrderBy(s => s.position).ToList();
|
||
var obj = new
|
||
{
|
||
proc_model.proc_id,
|
||
proc_model.name,
|
||
proc_model.step,
|
||
proc_model.tip,
|
||
material = proc_list
|
||
};
|
||
context.Response.Write(GetJsonWithCode(APICode.Success, obj));
|
||
context.Response.End();
|
||
}
|
||
|
||
public new bool IsReusable
|
||
{
|
||
get
|
||
{
|
||
return false;
|
||
}
|
||
}
|
||
|
||
}
|
||
} |