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

56 lines
1.8 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_Material_Get 的摘要说明
/// </summary>
public class Task_Material_Get : BasePage, IHttpHandler
{
DataService.BLL.zhc_task bll_task = new DataService.BLL.zhc_task();
DataService.BLL.zhc_task_material bll_task_material = new DataService.BLL.zhc_task_material();
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
public override void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
string taskId = context.Request.Params["task_id"];
if (string.IsNullOrEmpty(taskId))
{
context.Response.Write(GetJsonWithCode(APICode.Fail, "参数task_id不能为空"));
context.Response.End();
}
var task_model = bll_task.GetModel(taskId);
if (null == task_model)
{
context.Response.Write(GetJsonWithCode(APICode.Fail, "任务不存在参数task_id" + taskId));
context.Response.End();
}
var proc_list = bll_task_material.GetListOrderbyPosition(string.Format("taskId= '{0}' ", taskId));
var obj = new
{
task_model.taskId,
task_model.taskName,
task_model.taskType,
task_model.taskEquipment,
material = proc_list
};
context.Response.Write(GetJsonWithCode(APICode.Success, obj));
context.Response.End();
}
public new bool IsReusable
{
get
{
return false;
}
}
}
}