|  |  | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select * from h_v_QC_POStockInCheckBillList where 1 = 1 "; | 
 |  |  |                     string sql1 = "select * from h_v_QC_POStockInCheckBillList where 关闭人='' "; | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_QC_POStockInCheckBillList"); | 
 |  |  |                 } | 
 |  |  | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (sqlWhere == null || sqlWhere.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("select top 500 * from h_v_QC_FirstPieceCheckBillList ", "h_v_QC_FirstPieceCheckBillList"); | 
 |  |  |                     ds = oCN.RunProcReturn("select top 500 * from h_v_QC_FirstPieceCheckBillList  where  关闭人='' ", "h_v_QC_FirstPieceCheckBillList"); | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select * from h_v_QC_FirstPieceCheckBillList where 1 = 1 "; | 
 |  |  |                     string sql1 = "select * from h_v_QC_FirstPieceCheckBillList where 关闭人='' "; | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBillList"); | 
 |  |  |                 } | 
 |  |  | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (sqlWhere == null || sqlWhere.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillList ", "h_v_QC_PatrolProcCheckBillList"); | 
 |  |  |                     ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillList where  关闭人=''", "h_v_QC_PatrolProcCheckBillList"); | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select * from h_v_QC_PatrolProcCheckBillList where 1 = 1 "; | 
 |  |  |                     string sql1 = "select * from h_v_QC_PatrolProcCheckBillList where 关闭人='' "; | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_QC_PatrolProcCheckBillList"); | 
 |  |  |                 } | 
 |  |  | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 oCN.BeginTran();//开始事务 | 
 |  |  |                 ds = oCN.RunProcReturn("select * from QC_POStockInCheckBillMain where HInterID=" + HInterID, "QC_POStockInCheckBillMain"); | 
 |  |  |                 DataSet ds2 = oCN.RunProcReturn("select * from QC_POStockInCheckBillSub where HInterID=" + HInterID, "QC_POStockInCheckBillSub"); | 
 |  |  |                 ds = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillMain where HInterID=" + HInterID, "QC_FirstPieceCheckBillMain"); | 
 |  |  |                 DataSet ds2 = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillSub where HInterID=" + HInterID, "QC_FirstPieceCheckBillSub"); | 
 |  |  |                 if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 oCN.RunProc("update QC_POStockInCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID); | 
 |  |  |                 oCN.RunProc("update QC_POStockInCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID); | 
 |  |  |                 oCN.RunProc("update QC_FirstPieceCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID); | 
 |  |  |                 oCN.RunProc("update QC_FirstPieceCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID); | 
 |  |  |                 oCN.Commit();//提交事务 | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  | 
 |  |  |             ListModels oListModels = new ListModels(); | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 DAL.ClsQC_PatrolProcCheckBill oBill = new DAL.ClsQC_PatrolProcCheckBill(); | 
 |  |  |                 WebAPI.DLL.ClsQC_PatrolProcCheckBill oBill = new WebAPI.DLL.ClsQC_PatrolProcCheckBill(); | 
 |  |  |                 List<Model.ClsQC_PatrolProcCheckBillMain> lsmain = new List<Model.ClsQC_PatrolProcCheckBillMain>(); | 
 |  |  |                 msg2 = msg2.Replace("\\", ""); | 
 |  |  |                 msg2 = msg2.Replace("\n", "");  //\n | 
 |  |  | 
 |  |  |                     oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); | 
 |  |  |                     oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); | 
 |  |  |                     oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); | 
 |  |  |                     oItem.HBillType = "7503"; | 
 |  |  |                     oItem.HBillSubType = "7503"; | 
 |  |  |                     oItem.HBillType = "7506"; | 
 |  |  |                     oItem.HBillSubType = "7506"; | 
 |  |  |                     oItem.HBillStatus = 0; | 
 |  |  |                     oItem.HPeriod = 0; | 
 |  |  |                     oItem.HMaker = ""; | 
 |  |  | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 oCN.BeginTran();//开始事务 | 
 |  |  |                 ds = oCN.RunProcReturn("select * from QC_POStockInCheckBillMain where HInterID=" + HInterID, "QC_POStockInCheckBillMain"); | 
 |  |  |                 DataSet ds2 = oCN.RunProcReturn("select * from QC_POStockInCheckBillSub where HInterID=" + HInterID, "QC_POStockInCheckBillSub"); | 
 |  |  |                 ds = oCN.RunProcReturn("select * from QC_PatrolProcCheckBillMain where HInterID=" + HInterID, "QC_PatrolProcCheckBillMain"); | 
 |  |  |                 DataSet ds2 = oCN.RunProcReturn("select * from QC_PatrolProcCheckBillSub where HInterID=" + HInterID, "QC_PatrolProcCheckBillSub"); | 
 |  |  |                 if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 oCN.RunProc("update QC_POStockInCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID); | 
 |  |  |                 oCN.RunProc("update QC_POStockInCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID); | 
 |  |  |                 oCN.RunProc("update QC_PatrolProcCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID); | 
 |  |  |                 oCN.RunProc("update QC_PatrolProcCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID); | 
 |  |  |                 oCN.Commit();//提交事务 | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 1; |