|  |  |  | 
|---|
|  |  |  | string msg2 = sArray[0].ToString(); | 
|---|
|  |  |  | string msg3 = sArray[1].ToString(); | 
|---|
|  |  |  | string msg4 = sArray[2].ToString(); | 
|---|
|  |  |  | string msg5 = sArray[3].ToString(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //string UserName = ""; | 
|---|
|  |  |  | 
|---|
|  |  |  | oBill.DetailColl.Add(oItemSub); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //配件表体数据 | 
|---|
|  |  |  | //按 },{来拆分数组 //去掉【和】 | 
|---|
|  |  |  | //msg5 = msg5.Substring(1, msg5.Length - 2); | 
|---|
|  |  |  | msg5 = msg5.Replace("\\", ""); | 
|---|
|  |  |  | msg5 = msg5.Replace("\n", "");  //\n | 
|---|
|  |  |  | //msg2 = msg2.Replace("'", "’"); | 
|---|
|  |  |  | List<Model.ClsSb_EquipRepairWorkBillSub_Mater> ls1 = new List<Model.ClsSb_EquipRepairWorkBillSub_Mater>(); | 
|---|
|  |  |  | ls1 = JsonConvert.DeserializeObject<List<Model.ClsSb_EquipRepairWorkBillSub_Mater>>(msg5); | 
|---|
|  |  |  | int j = 0; | 
|---|
|  |  |  | foreach (Model.ClsSb_EquipRepairWorkBillSub_Mater oItemSub in ls1) | 
|---|
|  |  |  | { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | j++; | 
|---|
|  |  |  | oItemSub.HEntryID = i; | 
|---|
|  |  |  | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); | 
|---|
|  |  |  | oItemSub.HCloseType = false;   //关闭类型 | 
|---|
|  |  |  | oItemSub.HSourceInterID = 0;     // 源单主内码 | 
|---|
|  |  |  | oItemSub.HSourceEntryID = 0;   //源单子内码 | 
|---|
|  |  |  | oItemSub.HRelationQty = 0;     //关联数量 | 
|---|
|  |  |  | oBill.DetailColl_Mater.Add(oItemSub); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //保存 | 
|---|
|  |  |  | //保存完毕后处理 | 
|---|
|  |  |  | bool bResult; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region[设备维修列表编辑时获取表体数据] | 
|---|
|  |  |  | #region[设备维修列表编辑时获取表体数据(维修列表、配件列表)] | 
|---|
|  |  |  | [Route("Sb_EqpRepairWorkBill/Sb_EqpRepairWorkBillListProjectDetai")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | public object Sb_EqpRepairWorkBillListProjectDetai(string sqlWhere) | 
|---|
|  |  |  | public object Sb_EqpRepairWorkBillListProjectDetai(string HInterID) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | DataSet ds; | 
|---|
|  |  |  | DataSet ds, ds1; | 
|---|
|  |  |  | List<object> list = new List<object>(); | 
|---|
|  |  |  | string sqlWhere = ""; | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
|---|
|  |  |  | if (sqlWhere == null || sqlWhere.Equals("")) | 
|---|
|  |  |  | if (HInterID != "" || HInterID != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark   from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub"); | 
|---|
|  |  |  | ds = oCN.RunProcReturn("select HRepairID,维修项目代码 HRepairCode,维修项目 HRepairName,HManagerID1 HManagerID,表体负责人代码 HManagerCode,表体负责人 HManagerName,HRepairID1 HRepairID, 表体维修项目代码 HRepairCode,表体维修项目 HRepairName,表体维修要求 HRepairExplanation,表体备注 HRemark,源单主内码 HSourceInterID,源单子内码 HSourceEntryID,源单单号 HSourceBillNo,源单类型 HSourceBillType  from h_v_Sc_EquipRepairWorkBillList_Edit", "h_v_Sc_EquipRepairWorkBillList_Edit"); | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "获取信息成功!"; | 
|---|
|  |  |  | objJsonResult.data = ds.Tables[0]; | 
|---|
|  |  |  | sqlWhere = " and hmainid='" + HInterID + "'"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark  from Sc_MouldRepairWorkBillSub where 1 = 1 "; | 
|---|
|  |  |  | string sql1 = "select HRepairID,维修项目代码 HRepairCode,维修项目 HRepairName,HManagerID1 HManagerID,表体负责人代码 HManagerCode,表体负责人 HManagerName,HRepairID1 HRepairID, 表体维修项目代码 HRepairCode,表体维修项目 HRepairName,表体维修要求 HRepairExplanation,表体备注 HRemark ,源单主内码 HSourceInterID,源单子内码 HSourceEntryID,源单单号 HSourceBillNo,源单类型 HSourceBillType from h_v_Sc_EquipRepairWorkBillList_Edit where 1 = 1 "; | 
|---|
|  |  |  | string sql = sql1 + sqlWhere; | 
|---|
|  |  |  | ds = oCN.RunProcReturn(sql, "h_v_Sc_EquipRepairWorkBillList_Edit"); | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "获取信息成功!"; | 
|---|
|  |  |  | objJsonResult.data = ds.Tables[0]; | 
|---|
|  |  |  | sqlWhere = HInterID; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ds = oCN.RunProcReturn("select HRepairID,维修项目代码 HRepairCode,维修项目 HRepairName,HManagerID1 HManagerID,表体负责人代码 HManagerCode,表体负责人 HManagerName,HRepairID1 HRepairID, 表体维修项目代码 HRepairCode,表体维修项目 HRepairName,表体维修要求 HRepairExplanation,表体备注 HRemark,源单主内码 HSourceInterID,源单子内码 HSourceEntryID,源单单号 HSourceBillNo,源单类型 HSourceBillType  from h_v_Sc_EquipRepairWorkBillList_Edit where 1 = 1 " + sqlWhere , "h_v_Sc_EquipRepairWorkBillList_Edit"); | 
|---|
|  |  |  | string sql1 = "select * from h_v_Sb_EquipRepairWorkBillSub_Mater where 1 = 1 " + sqlWhere; | 
|---|
|  |  |  | ds1 = oCN.RunProcReturn(sql1, "h_v_Sb_EquipRepairWorkBillSub_Mater"); | 
|---|
|  |  |  | list.Add(ds.Tables[0]); | 
|---|
|  |  |  | list.Add(ds1.Tables[0]); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "获取信息成功!"; | 
|---|
|  |  |  | objJsonResult.list = list; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|