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

83 lines
2.6 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 Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
namespace VRS.Handler
{
/// <summary>
/// 科目步骤
/// </summary>
public class SubjectProc : BaseHandler, IHttpHandler
{
DataService.BLL.pro_subject bll_subject = new DataService.BLL.pro_subject();
DataService.BLL.pro_subject_proc bll_subject_proc = new DataService.BLL.pro_subject_proc();
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
if (null == context.Request["action"])
{
var result = GetResult(false, "缺少参数action");
context.Response.Write(result);
context.Response.End();
}
string action = context.Request["action"];
switch (action)
{
//按照船型 和 科目 查询步骤
case "queryproc":
QueryProc(context);
break;
default:
var result = GetResult(false, "方法名不存在:" + action);
context.Response.Write(result);
break;
}
}
/// <summary>
/// 按照船型 和 科目 查询步骤
/// </summary>
/// <param name="context"></param>
public void QueryProc(HttpContext context)
{
var ret = string.Empty;
var sign_boat = context.Request.Params["sign_boat"];
var subject_id = context.Request.Params["subject_id"];
if (string.IsNullOrEmpty(sign_boat))
{
ret = GetResult(false, "船型sign_boat 不能为空");
context.Response.Write(ret);
context.Response.End();
}
if (string.IsNullOrEmpty(subject_id))
{
ret = GetResult(false, "科目idsubject_id 不能为空");
context.Response.Write(ret);
context.Response.End();
}
var query = string.Format(" boatId='{0}' and subject_id='{1}' ", sign_boat, subject_id);
var subject_proc_list = bll_subject_proc.GetModelList(query);
var result = GetResult(true, subject_proc_list);
context.Response.Write(result);
context.Response.End();
}
public bool IsReusable
{
get
{
return false;
}
}
}
}