using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Linq;
|
using System.Net;
|
using System.Net.Http;
|
using System.Web.Http;
|
using WebAPI.Models;
|
|
namespace WebAPI.Controllers.MJJY
|
{
|
public class Mj_PDA_MoudlCheckController : ApiController
|
{
|
public DBUtility.ClsPub.Enum_BillStatus BillStatus;//单据状态(新增,修改,浏览,更新单价,变更)
|
|
private json objJsonResult = new json();
|
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
|
DataSet ds;
|
|
#region 模治具点检记录单
|
|
#region 根据模治具条码查找模具档案信息
|
[Route("Mj_PDA_MoudlCheckBill/txtHBarCode_KeyDown")]
|
[HttpGet]
|
public object txtHBarCode_KeyDown(string HBarCode)
|
{
|
try
|
{
|
if (HBarCode == null || HBarCode.Equals(""))
|
{
|
objJsonResult.code = "0";
|
objJsonResult.count = 0;
|
objJsonResult.Message = "条形码不能为空!";
|
objJsonResult.data = null;
|
return objJsonResult;
|
}
|
//得到信息
|
ds = oCN.RunProcReturn("select top 1 * from h_v_IF_Mould where 单据号= '" + HBarCode + "'", "h_v_IF_Mould");
|
//写入信息
|
if (ds == null || ds.Tables[0].Rows.Count == 0)
|
{
|
objJsonResult.code = "0";
|
objJsonResult.count = 0;
|
objJsonResult.Message = "未查询到模具信息!";
|
objJsonResult.data = null;
|
return objJsonResult;
|
}
|
objJsonResult.code = "1";
|
objJsonResult.count = 1;
|
objJsonResult.Message = "Sucess!";
|
objJsonResult.data = ds.Tables[0];
|
return objJsonResult;
|
}
|
catch (Exception e)
|
{
|
objJsonResult.code = "0";
|
objJsonResult.count = 0;
|
objJsonResult.Message = "Exception!" + e.ToString();
|
objJsonResult.data = null;
|
return objJsonResult;
|
}
|
|
#endregion
|
|
#endregion
|
|
}
|
}
|
}
|