|  |  | 
 |  |  |                 { | 
 |  |  |                     // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                     bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                     string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' "); | 
 |  |  |                     oCn.RunProc(sql); | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                     //修改成功 | 
 |  |  |                     //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  1,{oBill.omodel.HInterID.ToString()},' ' "); | 
 |  |  |                     string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); | 
 |  |  |                     oCn.RunProc(sql); | 
 |  |  |                 } | 
 |  |  |                 if (bResult) | 
 |  |  |                 { | 
 |  |  |                     string sql =string.Format($"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ") ; | 
 |  |  |                     oCn.RunProc(sql); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "保存成功!"; | 
 |  |  | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //删除前查找当前单据的所有器具ID | 
 |  |  |                 //string swhere = ""; | 
 |  |  |                 //DataSet ds = oCn.RunProcReturn("select HMaterID from Sc_MouldStockBillSub where HinterID=" + HInterID, "Sc_MouldStockBillSub"); | 
 |  |  |                 //for (var i = 0; i < ds.Tables[0].Rows.Count; i++) | 
 |  |  |                 //{ | 
 |  |  |                 //    swhere = swhere + ds.Tables[0].Rows[i]["HMaterID"].ToString() + ","; | 
 |  |  |                 //} | 
 |  |  |                 //swhere = swhere.Substring(0, swhere.Length - 1); | 
 |  |  |                 bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                 if (IsDete) | 
 |  |  |                 { | 
 |  |  |                     //删除成功修改器具档案位置 | 
 |  |  |                     //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  0,0,'{swhere}' "); | 
 |  |  |                     string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); | 
 |  |  |                     oCn.RunProc(sql); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |