gyhlw_dotnet/网站项目/VRS/Handler/VSATRemove.ashx.cs

58 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
{
/// <summary>
/// 接口VSAT拆解 返回流程json
/// </summary>
public class VSATRemove : BasePage, IHttpHandler
{
public override void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
bool state = false;
DataService.BLL.pro_flow bll = new DataService.BLL.pro_flow();
var subject_id = "10002";
var list = bll.GetModelListByStep(string.Format(" 1=1 and subject_id='{0}' ", subject_id));
if (list.Count > 0)
{
state = true;
List<Procedure> list_proc = new List<Procedure>();
foreach (var item in list)
{
var proc = new Procedure();
proc.name = item.desc;
proc.step = item.step.ToString();
proc.tip = item.tip;
proc.score = item.score;
list_proc.Add(proc);
}
var array_proc = list_proc.ToArray();
var obj = new
{
TaskName = "VSNT拆解",
TaskId = "1",
Procedure = array_proc
};
context.Response.Write(GetJsonWithCode(APICode.Success, new { subject_id = subject_id, json = obj }));
context.Response.End();
}
if (!state)
{
context.Response.Write(GetJsonWithCode(APICode.Fail, new { subject_id = subject_id }));
context.Response.End();
}
}
public new bool IsReusable
{
get
{
return false;
}
}
}
}