|  |  | 
 |  |  | using Newtonsoft.Json.Linq; | 
 |  |  | using Newtonsoft.Json; | 
 |  |  | using Newtonsoft.Json.Linq; | 
 |  |  | using Pub_Class; | 
 |  |  | using System; | 
 |  |  | using System.Collections.Generic; | 
 |  |  | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 List<object> columnNameList = new List<object>(); | 
 |  |  |  | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainBillList", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  | 
 |  |  |  | 
 |  |  |                 ds = Sc_MouldMaintainBillList_s(sWhere); | 
 |  |  |  | 
 |  |  |                 //添加列名 | 
 |  |  |                 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列对象的列名 | 
 |  |  |                 } | 
 |  |  |                 //if (ds.Tables[0].Rows.Count != 0 || ds != null) | 
 |  |  |                 //{ | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 objJsonResult.list = columnNameList; | 
 |  |  |                 return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 //else | 
 |  |  | 
 |  |  |  | 
 |  |  |                 ds = Sc_MouldDotCheckPlanBillList_s(sWhere); | 
 |  |  |  | 
 |  |  |                 //if (ds.Tables[0].Rows.Count != 0 || ds != null) | 
 |  |  |                 //{ | 
 |  |  |                 | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 //else | 
 |  |  |                 //{ | 
 |  |  |                 //objJsonResult.code = "0"; | 
 |  |  |                 //objJsonResult.count = 0; | 
 |  |  |                 //objJsonResult.Message = "无数据"; | 
 |  |  |                 //objJsonResult.data = null; | 
 |  |  |                 //return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                | 
 |  |  |             } | 
 |  |  |             catch (Exception ex) | 
 |  |  |             { | 
 |  |  | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 List<object> columnNameList = new List<object>(); | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckBillList", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  | 
 |  |  |                 } | 
 |  |  |                 ds = Sc_MouldDotCheckBillList_s(sWhere); | 
 |  |  |  | 
 |  |  |                 //if (ds.Tables[0].Rows.Count != 0 || ds != null) | 
 |  |  |                 //{ | 
 |  |  |                 //添加列名 | 
 |  |  |                 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列对象的列名 | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                  | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 objJsonResult.list = columnNameList; | 
 |  |  |  | 
 |  |  |                 return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 //else | 
 |  |  |                 //{ | 
 |  |  |                 //objJsonResult.code = "0"; | 
 |  |  |                 //objJsonResult.count = 0; | 
 |  |  |                 //objJsonResult.Message = "无数据"; | 
 |  |  |                 //objJsonResult.data = null; | 
 |  |  |                 //return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |             } | 
 |  |  |             catch (Exception ex) | 
 |  |  |             { | 
 |  |  | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 List<object> columnNameList = new List<object>(); | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Sc_MouldConkBookBillList", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  | 
 |  |  |  | 
 |  |  |                 ds = Sc_MouldConkBookBillList_s(sWhere); | 
 |  |  |  | 
 |  |  |                 //添加列名 | 
 |  |  |                 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列对象的列名 | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 objJsonResult.list = columnNameList; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |             catch (Exception ex) | 
 |  |  | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 List<object> columnNameList = new List<object>(); | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBillList", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  | 
 |  |  |  | 
 |  |  |                 ds = Sc_MouldRepairWorkBillList_s(sWhere); | 
 |  |  |  | 
 |  |  |                 //添加列名 | 
 |  |  |                 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列对象的列名 | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //if (ds.Tables[0].Rows.Count != 0 || ds != null) | 
 |  |  |                 //{ | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 objJsonResult.list = columnNameList; | 
 |  |  |                 return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 //else | 
 |  |  | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_IF_MoveStockBillList"); | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //if (ds.Tables[0].Rows.Count != 0 || ds != null) | 
 |  |  |                 //{ | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 //else | 
 |  |  |                 //{ | 
 |  |  |                 //objJsonResult.code = "0"; | 
 |  |  |                 //objJsonResult.count = 0; | 
 |  |  |                 //objJsonResult.Message = "无数据"; | 
 |  |  |                 //objJsonResult.data = null; | 
 |  |  |                 //return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                | 
 |  |  |             } | 
 |  |  |             catch (Exception ex) | 
 |  |  |             { | 
 |  |  | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         #region 调拨单  删除 | 
 |  |  |         [Route("Kf_MoveStockBill/DelteteGetMoveStockBill")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object DelteteGetMoveStockBill(string HInterID, string user) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //判断是否有删除权限 | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBill_Drop", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "无权限删除!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 oCN.BeginTran(); | 
 |  |  |                 oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID); | 
 |  |  |                 oCN.RunProc("Delete From Kf_ICStockBillSub 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; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// 销售出库单列表 | 
 |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         #region 其他出库单  删除 | 
 |  |  |         [Route("Kf_OtherOutBill/DelteteGetOtherOutBill")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object DelteteGetOtherOutBill(string HInterID, string user) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //判断是否有删除权限 | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Kf_OtherOutBill_Drop", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "无权限删除!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 oCN.BeginTran(); | 
 |  |  |                 oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID); | 
 |  |  |                 oCN.RunProc("Delete From Kf_ICStockBillSub 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; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// 委外出库单列表 | 
 |  |  | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_IF_ProductInBillList"); | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //if (ds.Tables[0].Rows.Count != 0 || ds != null) | 
 |  |  |                 //{ | 
 |  |  |               | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 //else | 
 |  |  |                 //{ | 
 |  |  |                 //objJsonResult.code = "0"; | 
 |  |  |                 //objJsonResult.count = 0; | 
 |  |  |                 //objJsonResult.Message = "无数据"; | 
 |  |  |                 //objJsonResult.data = null; | 
 |  |  |                 //return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 | 
 |  |  |             } | 
 |  |  |             catch (Exception ex) | 
 |  |  |             { | 
 |  |  | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |       | 
 |  |  |  | 
 |  |  |         #region 条码明细 | 
 |  |  |         [Route("Kf_ICStockBillSub_WMS/Kf_ICStockBillSub_WMS_List")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object Kf_ICStockBillSub_WMS_List(string sWhere, string user) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 ds = oCN.RunProcReturn(@"Select m.HNumber 物料代码,m.HName 物料名称,m.HModel 规格型号 | 
 |  |  |                                     ,wms.HBarCode 条码,wms.HQty 数量,w.HNumber 仓库代码,w.HName 仓库名称 from Kf_ICStockBillSub_WMS wms | 
 |  |  |                                     left join h_v_IF_Material m on wms.HMaterID = m.HItemID | 
 |  |  |                                     left join h_v_IF_Warehouse w on wms.HWhID = w.HItemID where 1=1 "+ sWhere, "Kf_ICStockBillSub_WMS"); | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 return objJsonResult; | 
 |  |  |               | 
 |  |  |             } | 
 |  |  |             catch (Exception ex) | 
 |  |  |             { | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "没有返回任何记录!" + ex.ToString(); | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         ///产品入库单删除功能 | 
 |  |  |         /// </summary> | 
 |  |  | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         #region 模具维修单保存/编辑 | 
 |  |  |         #region 模具维修记录单保存/编辑 | 
 |  |  |         /// <summary> | 
 |  |  |         /// 保存模具维修单 | 
 |  |  |         /// </summary> | 
 |  |  | 
 |  |  |             string msg2 = sArray[0].ToString(); | 
 |  |  |             string msg3 = sArray[1].ToString(); | 
 |  |  |             string msg4 = sArray[2].ToString(); | 
 |  |  |             string msg5 = sArray[3].ToString(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |             string UserName = ""; | 
 |  |  | 
 |  |  |                 List<Model.ClsSb_MouldRepairWorkBillSub> ls = new List<Model.ClsSb_MouldRepairWorkBillSub>(); | 
 |  |  |                 ls = oListModels.getObjectByJson_Gy_MouldRepairWorkBillSub(msg3); | 
 |  |  |                 int i = 0; | 
 |  |  |                 foreach (Model.ClsSb_MouldRepairWorkBillSub oItemSub in ls) | 
 |  |  |                 foreach (Model.ClsSb_MouldRepairWorkBillSub oItem in ls) | 
 |  |  |                 { | 
 |  |  |  | 
 |  |  |                     i++; | 
 |  |  |                     oItemSub.HEntryID = i; | 
 |  |  |                     oItem.HEntryID = i; | 
 |  |  |                     //oItemSub.HCloseMan = "";       //行关闭 | 
 |  |  |                     oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); | 
 |  |  |                     oItemSub.HCloseType = false;   //关闭类型 | 
 |  |  |                     oItem.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); | 
 |  |  |                     oItem.HCloseType = false;   //关闭类型 | 
 |  |  |                     //oItemSub.HRemark = "";         //备注 | 
 |  |  |                     oItemSub.HRelationQty = 0;     //关联数量 | 
 |  |  |                     oItem.HRelationQty = 0;     //关联数量 | 
 |  |  |                     //oItemSub.HRelationMoney = 0;   //关联金额 | 
 |  |  |                     //oItemSub.HRepairID = 0;       //维修项目 | 
 |  |  |                     //oItemSub.HRepairExplanation ="";   //维修要求 | 
 |  |  |                     //oItemSub.HManagerID = 0;   //负责人ID | 
 |  |  |                     //oItemSub.HMoney = 0;        //维修费用 | 
 |  |  |                     oBill.DetailColl.Add(oItemSub); | 
 |  |  |                     oBill.DetailColl.Add(oItem); | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //配件数据 | 
 |  |  |                 //按 },{来拆分数组 //去掉【和】 | 
 |  |  |                 msg5 = msg5.Substring(1, msg5.Length - 2); | 
 |  |  |                 msg5 = msg5.Replace("\\", ""); | 
 |  |  |                 msg5 = msg5.Replace("\n", "");  //\n | 
 |  |  |                 //msg2 = msg2.Replace("'", "’"); | 
 |  |  |                 List<Model.ClsSb_MouldRepairWorkBillSub_Item> ls1 = new List<Model.ClsSb_MouldRepairWorkBillSub_Item>(); | 
 |  |  |                 ls1 = oListModels.getObjectByJson_Gy_MouldRepairWorkBillSub_Item(msg5); | 
 |  |  |                 int j = 0; | 
 |  |  |                 foreach (Model.ClsSb_MouldRepairWorkBillSub_Item oItemSub in ls1) | 
 |  |  |                 { | 
 |  |  |  | 
 |  |  |                     j++; | 
 |  |  |                     oItemSub.HEntryID = j; | 
 |  |  |                     //oItemSub.HCloseMan = "";       //行关闭 | 
 |  |  |                     oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); | 
 |  |  |                     oItemSub.HCloseType = false;   //关闭类型 | 
 |  |  |                     //oItemSub.HRemark = "";         //备注 | 
 |  |  |                     oItemSub.HSourceInterID = 0;     // 源单主内码 | 
 |  |  |                     oItemSub.HSourceEntryID = 0;   //源单子内码 | 
 |  |  |                     //oItemSub.HSourceBillNo = "";  //源单单号 | 
 |  |  |                     //oItemSub.HSourceBillType = ""; //源单类型 | 
 |  |  |                     oItemSub.HRelationQty = 0;     //关联数量 | 
 |  |  |                     //oItemSub.HRelationMoney = 0;   //关联金额 | 
 |  |  |                     //HMaterID = "";//配件代码 | 
 |  |  |                     //HUnitID = "";//单位代码 | 
 |  |  |                     //HQty = "";//实际用量 | 
 |  |  |                     //HQtyMust = "";//单位用量 | 
 |  |  |                     //HRemark = "";//备注 | 
 |  |  |                     //oItemSub.HRepairID = 0;       //维修项目 | 
 |  |  |                     //oItemSub.HRepairExplanation ="";   //维修要求 | 
 |  |  |                     //oItemSub.HManagerID = 0;   //负责人ID | 
 |  |  |                     //oItemSub.HMoney = 0;        //维修费用 | 
 |  |  |                     oBill.DetailCol.Add(oItemSub); | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //保存 | 
 |  |  |                 //保存完毕后处理 | 
 |  |  |                 bool bResult; | 
 |  |  | 
 |  |  |         [HttpGet] | 
 |  |  |         public object Sb_MouldRepairWorkBillListProjectDetai(string sqlWhere) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             DataSet ds, ds1; | 
 |  |  |             List<object> list = new List<object>(); | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (sqlWhere == null || sqlWhere.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark   from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub"); | 
 |  |  |                     ds = oCN.RunProcReturn("select HRepairID, 子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark,源单主内码 HSourceInterID,源单子内码 HSourceEntryID,源单单号 HSourceBillNo,源单类型 HSourceBillType   from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit"); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                     objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark  from Sc_MouldRepairWorkBillSub where 1 = 1 "; | 
 |  |  |                     string sql1 = "select HRepairID,子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark,源单主内码 HSourceInterID,源单子内码 HSourceEntryID,源单单号 HSourceBillNo,源单类型 HSourceBillType   from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "; | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit"); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                     objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 string sql = "select HRepairID,子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark,源单主内码 HSourceInterID,源单子内码 HSourceEntryID,源单单号 HSourceBillNo,源单类型 HSourceBillType   from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "+ sqlWhere; | 
 |  |  |                 ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit"); | 
 |  |  |  | 
 |  |  |                 string sql1 = "select 配件ID HMaterID, 配件代码 HMaterNumber,配件名称 HMaterName,规格型号 HMaterSpec,单位ID HUnitID,计量单位代码 HUnitNumber,计量单位名称 HUnitName,用量 HQty,标准用量 HQtyMust,子备注1 HRemark,规格型号 HMaterSpec  from h_v_Sc_MouldRepairWorkBillSub_Item  where 1 = 1 " + sqlWhere ; | 
 |  |  |                 ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldRepairWorkBillSub_Item"); | 
 |  |  |  | 
 |  |  |                 list.Add(ds.Tables[0]); | 
 |  |  |                 list.Add(ds1.Tables[0]); | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 objJsonResult.list = list; | 
 |  |  |  | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  | 
 |  |  |             string msg2 = sArray[0].ToString(); | 
 |  |  |             string msg3 = sArray[1].ToString(); | 
 |  |  |             string msg4 = sArray[2].ToString(); | 
 |  |  |             string msg5 = sArray[3].ToString(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |             string UserName = ""; | 
 |  |  | 
 |  |  |                     } | 
 |  |  |                     oBill.omodel = oItem; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //保养项表体数据 | 
 |  |  |                 //按 },{来拆分数组 //去掉【和】 | 
 |  |  |                 msg5 = msg5.Substring(1, msg5.Length - 2); | 
 |  |  |                 msg5 = msg5.Replace("\\", ""); | 
 |  |  |                 msg5 = msg5.Replace("\n", "");  //\n | 
 |  |  |                 //msg2 = msg2.Replace("'", "’"); | 
 |  |  |                 List<Model.ClsSc_MouldMaintainPlanBillSub_Item> ls1 = new List<Model.ClsSc_MouldMaintainPlanBillSub_Item>(); | 
 |  |  |                 ls1 = oListModels.getObjectByJson_Gy_MouldMaintainPlanBillSub_Item(msg5); | 
 |  |  |                 int j = 0; | 
 |  |  |                 foreach (Model.ClsSc_MouldMaintainPlanBillSub_Item item in ls1) | 
 |  |  |                 { | 
 |  |  |  | 
 |  |  |                     j++; | 
 |  |  |                     item.HEntryID = j; | 
 |  |  |                     //oItemSub.HCloseMan = "";       //行关闭 | 
 |  |  |                     item.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); | 
 |  |  |                     item.HCloseType = false;   //关闭类型 | 
 |  |  |                     //oItemSub.HRemark = "";         //备注 | 
 |  |  |                     item.HSourceInterID = 0;     // 源单主内码 | 
 |  |  |                     item.HSourceEntryID = 0;   //源单子内码 | 
 |  |  |                     //oItemSub.HSourceBillNo = "";  //源单单号 | 
 |  |  |                     //oItemSub.HSourceBillType = ""; //源单类型 | 
 |  |  |                     item.HRelationQty = 0;     //关联数量 | 
 |  |  |                     oBill.DetailCol.Add(item); | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //表体数据 | 
 |  |  |                 //按 },{来拆分数组 //去掉【和】 | 
 |  |  |                 msg3 = msg3.Substring(1, msg3.Length - 2); | 
 |  |  | 
 |  |  |         [HttpGet] | 
 |  |  |         public object Sc_MouldMaintainPlanBillListProjectDetai(string sqlWhere) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             DataSet ds, ds1; | 
 |  |  |             List<object> list = new List<object>(); | 
 |  |  |             | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (sqlWhere == null || sqlWhere.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("select a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName,a.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,a.HQty,a.HQtyMust,a.HRemark  from Sc_MouldMaintainPlanBillSub a left join Gy_Unit u on a.HUnitID=u.HItemID left join h_v_IF_Material m on a.HMaterID=m.HItemID", "Sc_MouldMaintainPlanBillSub"); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                     objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName,a.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,a.HQty,a.HQtyMust,a.HRemark  from Sc_MouldMaintainPlanBillSub a left join Gy_Unit u on a.HUnitID=u.HItemID left join h_v_IF_Material m on a.HMaterID=m.HItemID where 1 = 1 "; | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainPlanBillSub"); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                     objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 } | 
 |  |  |                 //获取保养项目编辑数据 | 
 |  |  |                 string sql = "select 保养项目ID HMaintainItemID, 保养项目代码 HMaintainItemNumber,保养项目 HMaintainItem,保养部位 HMaintainPart,具体要求 HClaim,负责人ID,负责人代码 HManagerNumber,负责人名称 HManagerName,子备注2 HRemark,HMouldMaintainRuleID,HEquipDotCheckNo  from h_v_Sc_MouldMaintainPlanBillSub_Item where 1 = 1 " + sqlWhere + ""; | 
 |  |  |  | 
 |  |  |                 ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainPlanBillSub_Item"); | 
 |  |  |                 //获取配件项目编辑数据 | 
 |  |  |                 string sql1 = "select 配件ID HMaterID, 配件代码 HMaterNumber,配件名称 HMaterName,单位ID HUnitID,计量单位代码 HUnitNumber,计量单位名称 HUnitName,用量 HQty,标准用量 HQtyMust,子备注1 HRemark,规格型号 HMaterSpec  from h_v_Sc_MouldMaintainPlanBillSub  where 1 = 1 " + sqlWhere + ""; | 
 |  |  |                 ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainPlanBillSub"); | 
 |  |  |  | 
 |  |  |                 list.Add(ds.Tables[0]); | 
 |  |  |                 list.Add(ds1.Tables[0]); | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 objJsonResult.list = list; | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  | 
 |  |  |             string msg2 = sArray[0].ToString(); | 
 |  |  |             string msg3 = sArray[1].ToString(); | 
 |  |  |             string msg4 = sArray[2].ToString(); | 
 |  |  |             //string msg5 = sArray[3].ToString(); | 
 |  |  |  | 
 |  |  |             string UserName = ""; | 
 |  |  |             ListModels oListModels = new ListModels(); | 
 |  |  | 
 |  |  |                 { | 
 |  |  |                     //oItem.HMaker = ""; | 
 |  |  |                     UserName = oItem.HMaker;  //制单人 | 
 |  |  |                     oItem.HMaker = msg4; | 
 |  |  |                     oItem.HBillType = "3821"; | 
 |  |  |                     oItem.HBillSubType = "3821"; | 
 |  |  |  | 
 |  |  | 
 |  |  |                     oBill.DetailColl.Add(oItemSub); | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 ////配件项表体数据 | 
 |  |  |                 ////按 },{来拆分数组 //去掉【和】 | 
 |  |  |                 //msg5 = msg5.Substring(1, msg5.Length - 2); | 
 |  |  |                 //msg5 = msg5.Replace("\\", ""); | 
 |  |  |                 //msg5 = msg5.Replace("\n", "");  //\n | 
 |  |  |                 //                                //msg2 = msg2.Replace("'", "’"); | 
 |  |  |                 //List<Model.ClsSc_MouldDotCheckBillSub_Item> ls1 = new List<Model.ClsSc_MouldDotCheckBillSub_Item>(); | 
 |  |  |                 //ls1 = oListModels.getObjectByJson_Sc_MouldDotCheckBillSub_Item(msg5); | 
 |  |  |                 //int j = 0; | 
 |  |  |                 //foreach (Model.ClsSc_MouldDotCheckBillSub_Item oItemSub in ls1) | 
 |  |  |                 //{ | 
 |  |  |  | 
 |  |  |                 //    j++; | 
 |  |  |                 //    oItemSub.HEntryID = j; | 
 |  |  |                 //    //oItemSub.HCloseMan = "";       //行关闭 | 
 |  |  |                 //    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); | 
 |  |  |                 //    oItemSub.HCloseType = false;   //关闭类型 | 
 |  |  |  | 
 |  |  |                 //    oItemSub.HSourceInterID = 0;     // 源单主内码 | 
 |  |  |                 //    oItemSub.HSourceEntryID = 0;   //源单子内码 | 
 |  |  |  | 
 |  |  |                 //    oItemSub.HRelationQty = 0;     //关联数量 | 
 |  |  |                 //    oBill.DetailCol.Add(oItemSub); | 
 |  |  |                 //} | 
 |  |  |  | 
 |  |  |                 //保存 | 
 |  |  |                 //保存完毕后处理 | 
 |  |  |                 bool bResult; | 
 |  |  | 
 |  |  |         [HttpGet] | 
 |  |  |         public object Sc_MouldDotCheckBillListProjectDetai(string sqlWhere) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             DataSet ds, ds1; | 
 |  |  |             List<object> list = new List<object>(); | 
 |  |  |             string Swhere = ""; | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (sqlWhere == null || sqlWhere.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("select HDotCheckItemID,点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,表体备注 HRemark,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName from h_v_Sc_MouldDotCheckBillList", "h_v_Sc_MouldDotCheckBillList"); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                     objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select HDotCheckItemID,点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,表体备注 HRemark,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName from h_v_Sc_MouldDotCheckBillList where 1 = 1 "; | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckBillList"); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                     objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 } | 
 |  |  |                 //获取点检项目编辑数据 | 
 |  |  |                 ds = oCN.RunProcReturn("select HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckBillSub a left join Gy_Employee e on a.HManagerID=e.HItemID where 1=1 " + sqlWhere, "Sc_MouldDotCheckBillSub"); | 
 |  |  |                 //获取配件项目编辑数据 | 
 |  |  |                 ds1 = oCN.RunProcReturn(@"select b.HMaterID,  mt.Hnumber HMaterNumber ,mt.HName HMaterName, b.HUnitID | 
 |  |  |                     ,u2.hnumber HUnitNumber,u2.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark  | 
 |  |  |                     from Sc_MouldDotCheckBillSub_Item b  | 
 |  |  |                     left join Gy_Material mt on b.HMaterID=mt.HItemID  | 
 |  |  |                     left join h_v_IF_Unit u2 on b.HUnitID=u2.HItemID  where 1=1 " + sqlWhere, "Sc_MouldDotCheckBillSub_Item"); | 
 |  |  |                 list.Add(ds.Tables[0]); | 
 |  |  |                 list.Add(ds1.Tables[0]); | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 objJsonResult.list = list; | 
 |  |  |  | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  | 
 |  |  |             return objJsonResult; | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region[模具点检记录表选择点检计划带出表格数据] | 
 |  |  |         [Route("Sc_MouldDotCheckBill/Sc_MouldDotCheckSubBillListByPlan")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object Sc_MouldDotCheckSubBillListByPlan(string HPlanInterID) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 string sql1 = "select hsubid HDotCheckItemID,点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,表体备注 HRemark,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName from h_v_Sc_MouldDotCheckPlanBillList where hmainid =" + HPlanInterID; | 
 |  |  |                 ds = oCN.RunProcReturn(sql1, "h_v_Sc_MouldDotCheckPlanBillList"); | 
 |  |  |                 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 | 
 |  |  |         #region [模具点检记录表删除功能] | 
 |  |  |         /// <summary> | 
 |  |  |         /// 模具点检记录删除功能 | 
 |  |  | 
 |  |  |             string msg2 = sArray[0].ToString(); | 
 |  |  |             string msg3 = sArray[1].ToString(); | 
 |  |  |             string msg4 = sArray[2].ToString(); | 
 |  |  |             //string msg5 = sArray[3].ToString(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |             string UserName = ""; | 
 |  |  | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 DBUtility.ClsPub.CurUserName = msg4; | 
 |  |  |                 DAL.ClsSc_MouldDotCheckPlanBill oBill = new DAL.ClsSc_MouldDotCheckPlanBill(); | 
 |  |  |                 List<Model.ClsSc_MouldDotCheckPlanBillMain> lsmain = new List<Model.ClsSc_MouldDotCheckPlanBillMain>(); | 
 |  |  |                 msg2 = msg2.Replace("\\", ""); | 
 |  |  | 
 |  |  |                 { | 
 |  |  |                     //oItem.HMaker = ""; | 
 |  |  |                     UserName = oItem.HMaker;  //制单人 | 
 |  |  |                     oItem.HBillType = "3821"; | 
 |  |  |                     oItem.HBillSubType = "3821"; | 
 |  |  |                     oItem.HBillType = "3820"; | 
 |  |  |                     oItem.HBillSubType = "3820"; | 
 |  |  |  | 
 |  |  |                     //oItem.HInterID =0; | 
 |  |  |                     //oItem.HBillNo = ""; | 
 |  |  | 
 |  |  |                     } | 
 |  |  |                     oBill.omodel = oItem; | 
 |  |  |                 } | 
 |  |  |                 //表体数据 | 
 |  |  |                 //点检项目表体数据 | 
 |  |  |                 //按 },{来拆分数组 //去掉【和】 | 
 |  |  |                 msg3 = msg3.Substring(1, msg3.Length - 2); | 
 |  |  |                 msg3 = msg3.Replace("\\", ""); | 
 |  |  | 
 |  |  |                     oBill.DetailColl.Add(oItemSub); | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 ////配件项表体数据 | 
 |  |  |                 ////按 },{来拆分数组 //去掉【和】 | 
 |  |  |                 //msg5 = msg5.Substring(1, msg5.Length - 2); | 
 |  |  |                 //msg5 = msg5.Replace("\\", ""); | 
 |  |  |                 //msg5 = msg5.Replace("\n", "");  //\n | 
 |  |  |                 //                                //msg2 = msg2.Replace("'", "’"); | 
 |  |  |                 //List<Model.ClsSc_MouldDotCheckPlanBillSub_Item> ls1 = new List<Model.ClsSc_MouldDotCheckPlanBillSub_Item>(); | 
 |  |  |                 //ls1 = oListModels.getObjectByJson_Sc_MouldDotCheckPlanBillSub_Item(msg5); | 
 |  |  |                 //int j = 0; | 
 |  |  |                 //foreach (Model.ClsSc_MouldDotCheckPlanBillSub_Item oItemSub in ls1) | 
 |  |  |                 //{ | 
 |  |  |  | 
 |  |  |                 //    j++; | 
 |  |  |                 //    oItemSub.HEntryID = j; | 
 |  |  |                 //    //oItemSub.HCloseMan = "";       //行关闭 | 
 |  |  |                 //    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); | 
 |  |  |                 //    oItemSub.HCloseType = false;   //关闭类型 | 
 |  |  |  | 
 |  |  |                 //    oItemSub.HSourceInterID = 0;     // 源单主内码 | 
 |  |  |                 //    oItemSub.HSourceEntryID = 0;   //源单子内码 | 
 |  |  |  | 
 |  |  |                 //    oItemSub.HRelationQty = 0;     //关联数量 | 
 |  |  |                 //    oBill.DetailCol.Add(oItemSub); | 
 |  |  |                 //} | 
 |  |  |  | 
 |  |  |                 //保存 | 
 |  |  |                 //保存完毕后处理 | 
 |  |  |                 bool bResult; | 
 |  |  | 
 |  |  |         [HttpGet] | 
 |  |  |         public object Sc_MouldDotCheckPlanBillListProjectDetai(string sqlWhere) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             DataSet ds, ds1; | 
 |  |  |             List<object> list = new List<object>(); | 
 |  |  |             string Swhere = ""; | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (sqlWhere == null || sqlWhere.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("select HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckPlanBillSub a left join Gy_Employee e on a.HManagerID=e.HItemID", "Sc_MouldDotCheckPlanBillSub"); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                     objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckPlanBillSub a left join Gy_Employee e on a.HManagerID=e.HItemID where 1 = 1 "; | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "Sc_MouldDotCheckPlanBillSub"); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                     objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 } | 
 |  |  |                 //获取点检项目编辑数据 | 
 |  |  |                 ds = oCN.RunProcReturn(@"select a.HDotCheckItemID,HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckPlanBillSub a  | 
 |  |  |                   left join Gy_Employee e on a.HManagerID=e.HItemID | 
 |  |  |                         where 1=1 " + sqlWhere, "Sc_MouldDotCheckPlanBillSub"); | 
 |  |  |                 ////获取配件项目编辑数据 | 
 |  |  |                 //ds1 = oCN.RunProcReturn(@"select b.HMaterID,  mt.Hnumber HMaterNumber ,mt.HName HMaterName, b.HUnitID | 
 |  |  |                 //    ,u2.hnumber HUnitNumber,u2.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark  | 
 |  |  |                 //    from Sc_MouldDotCheckPlanBillSub_Item b  | 
 |  |  |                 //    left join Gy_Material mt on b.HMaterID=mt.HItemID  | 
 |  |  |                 //    left join h_v_IF_Unit u2 on b.HUnitID=u2.HItemID  where 1=1 " + sqlWhere, "Sc_MouldDotCheckPlanBillSub_Item"); | 
 |  |  |                 list.Add(ds.Tables[0]); | 
 |  |  |                 //list.Add(ds1.Tables[0]); | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 objJsonResult.list = list; | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  | 
 |  |  |                     ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,HPropertyID,辅助属性代码 HPropertyCode,辅助属性名称 HPropertyName, | 
 |  |  |                                             HSecUnitID, 辅助计量单位代码 HSecUnitCode, 辅助计量单位名称 HSecUnitName, HUnitID, 计量单位代码 HUnitCode, 计量单位名称 HUnitName, 批次 HBatchNo, | 
 |  |  |                                             设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 使用寿命 HUseLife, 实收数量 HQty, 单价 HPrice, 金额 HMoney, HWHID, 收料仓库代码 HWHCode, 收料仓库名称 HWHName, | 
 |  |  |                                             HSPID, 仓位代码 HSPCode, 仓位名称 HSPName, 备注 HRemark,HStockOrgID | 
 |  |  |                                             HSPID, 仓位代码 HSPCode, 仓位名称 HSPName, 子备注 HRemark,HStockOrgID | 
 |  |  |                                             FROM h_v_Sc_MouldScrapInHouseBillList"), "h_v_Sc_MouldScrapInHouseBillList"); | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  | 
 |  |  |                     string sql1 = string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,HPropertyID,辅助属性代码 HPropertyCode,辅助属性名称 HPropertyName, | 
 |  |  |                                             HSecUnitID, 辅助计量单位代码 HSecUnitCode, 辅助计量单位名称 HSecUnitName, HUnitID, 计量单位代码 HUnitCode, 计量单位名称 HUnitName, 批次 HBatchNo, | 
 |  |  |                                             设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 使用寿命 HUseLife, 实收数量 HQty, 单价 HPrice, 金额 HMoney, HWHID, 收料仓库代码 HWHCode, 收料仓库名称 HWHName, | 
 |  |  |                                             HSPID, 仓位代码 HSPCode, 仓位名称 HSPName, 备注 HRemark,HStockOrgID | 
 |  |  |                                             HSPID, 仓位代码 HSPCode, 仓位名称 HSPName, 子备注 HRemark,HStockOrgID | 
 |  |  |                                             FROM h_v_Sc_MouldScrapInHouseBillList where 1 = 1 "); | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldScrapInHouseBillList"); | 
 |  |  | 
 |  |  |                 { | 
 |  |  |                     // 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 = $"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' "; | 
 |  |  |                     oCn.RunProc(sql); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "保存成功!"; | 
 |  |  | 
 |  |  |             string sql1 = string.Format(@"select * from h_v_Sc_MouldScrapOutHouseBillList where 库存组织='" + Organization + "'"); | 
 |  |  |             if (sWhere == null || sWhere.Equals("")) | 
 |  |  |             { | 
 |  |  |                 return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by hmainid desc", "h_v_Sc_MouldScrapOutHouseBillList"); | 
 |  |  |                 return new SQLHelper.ClsCN().RunProcReturn(sql1 + " order by 制单日期 desc", "h_v_Sc_MouldScrapOutHouseBillList"); | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             { | 
 |  |  |                 string sql = sql1 + sWhere + "order by hmainid desc"; | 
 |  |  |                 string sql = sql1 + sWhere + " order by 制单日期 desc"; | 
 |  |  |                 return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldScrapOutHouseBillList"); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  | 
 |  |  |                 { | 
 |  |  |                     // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                     bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                     string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus  'out','{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 = $"exec h_p_Sc_MouldChangeFileStatus  'out','{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; | 
 |  |  | 
 |  |  |             string sql1 = string.Format(@"select * from h_v_Sc_MouldProdBackBillList where 库存组织='" + Organization + "'"); | 
 |  |  |             if (sWhere == null || sWhere.Equals("")) | 
 |  |  |             { | 
 |  |  |                 return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by hmainid desc", "h_v_Sc_MouldProdBackBillList"); | 
 |  |  |                 return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 制单日期 desc", "h_v_Sc_MouldProdBackBillList"); | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             { | 
 |  |  |                 string sql = sql1 + sWhere + "order by hmainid desc"; | 
 |  |  |                 string sql = sql1 + sWhere + "order by 制单日期 desc"; | 
 |  |  |                 return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList"); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  | 
 |  |  |                     ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo, | 
 |  |  |                                                 设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty,  | 
 |  |  |                                                 单价 HPrice, 金额 HMoney,收料仓库ID HWHID, 收料仓库代码 HWHCode, 收料仓库 HWHName,HSPID,  | 
 |  |  |                                                 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdBackBillList"), "h_v_Sc_MouldProdBackBillList"); | 
 |  |  |                                                 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdBackBillList"), "h_v_Sc_MouldProdBackBillList"); | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  | 
 |  |  |                     string sql1 = string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo, | 
 |  |  |                                                 设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty,  | 
 |  |  |                                                 单价 HPrice, 金额 HMoney,收料仓库ID HWHID, 收料仓库代码 HWHCode, 收料仓库 HWHName,HSPID,  | 
 |  |  |                                                 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdBackBillList where 1 = 1 "); | 
 |  |  |                                                 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdBackBillList where 1 = 1 "); | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList"); | 
 |  |  |  | 
 |  |  | 
 |  |  |                 { | 
 |  |  |                     // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                     bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                    | 
 |  |  |                     string sql1 = string.Format($"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' "); | 
 |  |  |                     oCn.RunProc(sql1); | 
 |  |  |                 } | 
 |  |  |                 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 = $"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' "; | 
 |  |  |                     string sql =string.Format($"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' ") ; | 
 |  |  |                     oCn.RunProc(sql); | 
 |  |  |                     string sql1 = $"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' "; | 
 |  |  |                     oCn.RunProc(sql1); | 
 |  |  |                     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; | 
 |  |  | 
 |  |  |             if (sWhere == null || sWhere.Equals("")) | 
 |  |  |             { | 
 |  |  |                 Log.LogInfo(sql1); | 
 |  |  |                 return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by hmainid desc", "h_v_Sc_MouldProdOutHouseBillList"); | 
 |  |  |                 return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 制单日期 desc", "h_v_Sc_MouldProdOutHouseBillList"); | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             { | 
 |  |  |                 string sql = sql1 + sWhere + "order by hmainid desc"; | 
 |  |  |                 string sql = sql1 + sWhere + "order by 制单日期 desc"; | 
 |  |  |                 return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdOutHouseBillList"); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  | 
 |  |  |                     ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo, | 
 |  |  |                                                 设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty,  | 
 |  |  |                                                 单价 HPrice, 金额 HMoney,HWHSonID HWHID, 发料仓库代码 HWHCode, 发料仓库 HWHName,HSPID,  | 
 |  |  |                                                 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdOutHouseBillList"), "h_v_Sc_MouldProdOutHouseBillList"); | 
 |  |  |                                                 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdOutHouseBillList"), "h_v_Sc_MouldProdOutHouseBillList"); | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  | 
 |  |  |                     string sql1 = string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo, | 
 |  |  |                                                 设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty,  | 
 |  |  |                                                 单价 HPrice, 金额 HMoney,HWHSonID HWHID, 发料仓库代码 HWHCode, 发料仓库 HWHName,HSPID,  | 
 |  |  |                                                 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdOutHouseBillList where 1 = 1 "); | 
 |  |  |                                                 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdOutHouseBillList where 1 = 1 "); | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdOutHouseBillList"); | 
 |  |  |                 } | 
 |  |  | 
 |  |  |                 { | 
 |  |  |                     // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                     bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                     string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus  'out','{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 = $"exec h_p_Sc_MouldChangeFileStatus  'out','{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; | 
 |  |  | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 List<object> columnNameList = new List<object>(); | 
 |  |  |  | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Sc_MouldLifeChangeBillList", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  | 
 |  |  |  | 
 |  |  |                 ds = Sc_GetMouldLifeChangeBill(sWhere); | 
 |  |  |  | 
 |  |  |                 //添加列名 | 
 |  |  |                 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列对象的列名 | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "返回记录成功!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 objJsonResult.list = columnNameList; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |             catch (Exception ex) | 
 |  |  | 
 |  |  |                     ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具 HMaterName,规格型号 HMaterSpec,HPropertyID,辅助属性代码 HPropertyCode,辅助属性 HPropertyName, | 
 |  |  |                                                            HSecUnitID, 辅助计量单位代码 HSecUnitCode, 辅助计量单位 HSecUnitName,换算率 HSecUnitRate, | 
 |  |  |                                                            HUnitID, 计量单位代码 HUnitCode, 计量单位 HUnitName, | 
 |  |  |                                                            设计寿命 HDesignLife, 原剩余寿命 HLeaveLife, 新剩余寿命 HNewLife,表体备注 HRemark  | 
 |  |  |                                                            设计寿命 HDesignLife, 原剩余寿命 HLeaveLife, 新剩余寿命 HNewLeaveLife,表体备注 HRemark  | 
 |  |  |                                                           FROM h_v_Sc_MouldLifeChangeBillList_Edit"), "h_v_Sc_MouldLifeChangeBillList_Edit"); | 
 |  |  |  | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  | 
 |  |  |                     string sql1 = string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具 HMaterName,规格型号 HMaterSpec,HPropertyID,辅助属性代码 HPropertyCode,辅助属性 HPropertyName, | 
 |  |  |                                                   HSecUnitID, 辅助计量单位代码 HSecUnitCode, 辅助计量单位 HSecUnitName,换算率 HSecUnitRate, | 
 |  |  |                                                   HUnitID, 计量单位代码 HUnitCode, 计量单位 HUnitName, | 
 |  |  |                                                   设计寿命 HDesignLife, 原剩余寿命 HLeaveLife, 新剩余寿命 HNewLife,表体备注 HRemark  | 
 |  |  |                                                   设计寿命 HDesignLife, 原剩余寿命 HLeaveLife, 新剩余寿命 HNewLeaveLife,表体备注 HRemark  | 
 |  |  |                                                  FROM h_v_Sc_MouldLifeChangeBillList_Edit where 1 = 1 "); | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldLifeChangeBillList_Edit"); |