| | |
| | | DataSet ds1; |
| | | |
| | | |
| | | #region[编辑时获取表头数据] |
| | | [Route("QC_LastPieceCheckBill/QC_LastPieceCheckBillListCheckDetail")] |
| | | [HttpGet] |
| | | public ApiResult<DataSet> QC_LastPieceCheckBillListCheckDetail(string HID) |
| | | { |
| | | if (string.IsNullOrEmpty(HID)) |
| | | return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" }; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | var dataSet = oCN.RunProcReturn("select top 1 * from h_v_QC_LastPieceCheckBillListDetail where hmainid= " + HID + " ", "h_v_QC_LastPieceCheckBillListDetail"); |
| | | if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) |
| | | return new ApiResult<DataSet> { code = -1, msg = "不存在结算单号" }; |
| | | |
| | | return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet }; |
| | | } |
| | | #endregion |
| | | |
| | | #region[编辑时获取表体数据] |
| | | [Route("QC_LastPieceCheckBill/QC_LastPieceCheckBillListProjectDetai")] |
| | | [HttpGet] |
| | | public object QC_LastPieceCheckBillListProjectDetai(string sqlWhere) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | string sql1 = "SELECT 日期,单据号,备注,产品内码, 产品名称" + |
| | | ", 产品型号, 检验员代码, 检验员名称, 制单人, 制单日期" + |
| | | ", 审核人, 审核日期, 修改人, 修改日期, 关闭人, 关闭日期 FROM h_v_QC_LastPieceCheckBillListDetail where 1 = 1 "; |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_QC_LastPieceCheckBillListDetail"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 新增单据-保存按钮 |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | /// <summary> |
| | | ///删除功能 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("QC_LastPieceCheckBill/DeltetLastPieceCheckBill")] |
| | | [HttpGet] |
| | | public object DeltetLastPieceCheckBill(string HInterID) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From QC_LastPieceCheckBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From QC_LastPieceCheckBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 返回产品入库检验单列表 |
| | | ///参数:string sql。 |