|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region 采购入库单分页列表 | 
|---|
|  |  |  | [Route("Kf_POStockInBill/page")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | public object Kf_POStockInBillPage(string sWhere, string user, int page, int size) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | DataSet ds; | 
|---|
|  |  |  | json res = new json(); | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | List<object> columnNameList = new List<object>(); | 
|---|
|  |  |  | //判断权限 | 
|---|
|  |  |  | //if (!DBUtility.ClsPub.Security_Log("Kf_POStockInBillList", 1, false, user)) | 
|---|
|  |  |  | //{ | 
|---|
|  |  |  | //    objJsonResult.code = CodeConstant.FAIL; | 
|---|
|  |  |  | //    objJsonResult.count = CountConstant.FAIL; | 
|---|
|  |  |  | //    objJsonResult.Message = "您没有该模块权限,请与管理员联系!"; | 
|---|
|  |  |  | //    objJsonResult.data = null; | 
|---|
|  |  |  | //    return objJsonResult; | 
|---|
|  |  |  | //} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | sWhere = sWhere.Replace("'", "''"); | 
|---|
|  |  |  | if (sWhere == null || sWhere.Equals("")) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | ds = oCN.RunProcReturn("exec h_p_Kf_POStockInBillList_New " + page + "," + size + ",''", "h_p_Kf_POStockInBillList_New"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | ds = oCN.RunProcReturn("exec h_p_Kf_POStockInBillList_New " + page + "," + size + ",'" + sWhere + "'", "h_p_Kf_POStockInBillList_New"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //添加列名 | 
|---|
|  |  |  | foreach (DataColumn col in ds.Tables[0].Columns) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Type dataType = col.DataType; | 
|---|
|  |  |  | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; | 
|---|
|  |  |  | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | res.code = CodeConstant.SUCCEED; | 
|---|
|  |  |  | res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); | 
|---|
|  |  |  | res.Message = "Sucess!"; | 
|---|
|  |  |  | res.list = columnNameList; | 
|---|
|  |  |  | res.data = ds.Tables[0]; | 
|---|
|  |  |  | return res; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | res.code = CodeConstant.FAIL; | 
|---|
|  |  |  | res.count = CountConstant.FAIL; | 
|---|
|  |  |  | res.Message = "Exception!" + e.ToString(); | 
|---|
|  |  |  | res.data = null; | 
|---|
|  |  |  | return res; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region 采购入库单 保存/编辑功能 | 
|---|
|  |  |  | [Route("Kf_POStockInBill/POStockInBillEdit")] | 
|---|
|  |  |  | [HttpPost] | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String sql = $@"update Kf_ICStockBillMain  set " + | 
|---|
|  |  |  | "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + | 
|---|
|  |  |  | "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + ",HBillNo='" + HBillNo + "'" + | 
|---|
|  |  |  | ",HSupID=" + HSupID + ",HCurID=" + HCurID + ",HSecManagerID=" + HSecManagerID + ", HSTOCKORGID=" + HSTOCKORGID + ",HKeeperID=" + HKeeperID + ",HWHID = " + HWHID | 
|---|
|  |  |  | + ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID + ",HOWNERID=" + HOWNERID | 
|---|
|  |  |  | + ",HAddress='" + HAddress + "',HInnerBillNo='" + HInnerBillNo + "',HProjectID="+ HProjectID + ",HInvoiceBillNo='"+ HInvoiceBillNo + "' where HInterID=" + HInterID; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | string sql = "select * from h_v_Kf_POStockInBillQuerySub where hmainid =  " + hmainid; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ds = oCN.RunProcReturn(sql + " order by hsubid desc", "h_v_Kf_POStockInBillQuerySub"); | 
|---|
|  |  |  | ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_Kf_POStockInBillQuerySub"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | foreach (DataColumn col in ds.Tables[0].Columns) | 
|---|