| 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 Cj_CallGoodsBillMainController : ApiController | 
|     { | 
|         private json objJsonResult = new json(); | 
|         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
|         DataSet ds; | 
|   | 
|         #region 叫料单列表 | 
|         [Route("Cj_CallGoodsBillMain/CallGoodsBillMainList")] | 
|         [HttpGet] | 
|         public object CallGoodsBillMainList(string sWhere,string user) | 
|         { | 
|             try | 
|             { | 
|                 //判断是否有查询权限 | 
|                 if (!DBUtility.ClsPub.Security_Log("Cj_CallGoodsBill_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_JIT_CallGoodsBillList where 1=1 " + sWhere + " and 制单人='"+user+"'  order by hmainid desc", "h_v_IF_JIT_CallGoodsBillList"); | 
|   | 
|                 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 | 
|   | 
|         #region 叫料表列表 删除 | 
|         [Route("Cj_CallGoodsBillMain/DelCallGoodsBill")] | 
|         [HttpGet] | 
|         public object DelCallGoodsBill(string HInterID,string HEntryID, string user) | 
|         { | 
|             try | 
|             { | 
|                 //判断是否有查询权限 | 
|                 if (!DBUtility.ClsPub.Security_Log("Cj_CallGoodsBill_Drop", 1, false, user)) | 
|                 { | 
|                     objJsonResult.code = "0"; | 
|                     objJsonResult.count = 0; | 
|                     objJsonResult.Message = "无查询权限"; | 
|                     objJsonResult.data = null; | 
|                     return objJsonResult; | 
|                 } | 
|   | 
|                 ds = oCN.RunProcReturn($"exec h_p_JIT_CallGoodsBillList_Delete {HInterID},{HEntryID}", "h_p_JIT_CallGoodsBillList_Delete"); | 
|   | 
|                 objJsonResult.code = ds.Tables[0].Rows[0][0].ToString(); | 
|                 objJsonResult.count =int.Parse(ds.Tables[0].Rows[0][0].ToString()); | 
|                 objJsonResult.Message = ds.Tables[0].Rows[0][1].ToString(); | 
|                 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 | 
|   | 
|     } | 
| } |