using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.Http; using WebAPI.Models; namespace WebAPI.Controllers.CJGL { public class Sc_WorkBillAutoSortBillMainController : ApiController { private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; #region 生产日计划单列表 [Route("Sc_WorkBillAutoSortBillMain/WorkBillAutoSortBillMainList")] [HttpGet] public object CallGoodsBillMainList(string sWhere, string user) { try { //判断是否有查询权限 if (!DBUtility.ClsPub.Security_Log("Sc_WorkBillAutoSortBillMain_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "无查询权限"; objJsonResult.data = null; return objJsonResult; } ds = oCN.RunProcReturn("select * from h_v_IF_Sc_WorkBillAutoSortBillMain where 1=1 " + sWhere + " order by hmainid desc", "h_v_IF_Sc_WorkBillAutoSortBillMain"); 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 = "没有返回任何记录!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion } }