using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace VRS.Handler
{
///
///接口:VSAT安装 返回流程json
///
public class VSATInstall : 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 = "10001";
var list = bll.GetModelListByStep(string.Format(" 1=1 and subject_id='{0}' ", subject_id));
if (list.Count > 0)
{
state = true;
List list_proc = new List();
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;
}
}
}
}