61 lines
1.8 KiB
C#
61 lines
1.8 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Web;
|
||
|
||
namespace VRS.Handler
|
||
{
|
||
/// <summary>
|
||
///接口:VSAT安装 返回流程json
|
||
/// </summary>
|
||
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<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;
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
} |