gyhlw_dotnet/网站项目/VRS/Handler/ZHC/Task_Proc_Material_Get.ashx.cs

58 lines
2.0 KiB
C#
Raw 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.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;
}
}
}
}