| | |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //获取保养项目编辑数据 |
| | | string sql = "select 保养项目ID HMaintainItemID,保养项目代码 HMaintainItemNumber,保养项目 HMaintainItem,保养部位 HMaintainPart,具体要求 HClaim,负责人ID HManagerID,负责人代码 HManagerNumber,负责人名称 HManagerName,子备注2 HRemark from h_v_Sc_MouldMaintainRuleBillSub_Item where 1 = 1 " + Swhere + ""; |
| | | string sql = "select 保养项目ID HMaintainItemID,保养项目代码 HMaintainItemNumber,保养项目 HMaintainItem,保养部位 HMaintainPart,具体要求 HClaim,负责人ID HManagerID,负责人代码 HManagerNumber,负责人名称 HManagerName,子备注2 HRemark, 保养结果 HStdMaintainResult from h_v_Sc_MouldMaintainRuleBillSub_Item where 1 = 1 " + Swhere + ""; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainRuleBillSub_Item"); |
| | | //获取配件项目编辑数据 |
| | | string sql1 = "select 配件ID HMaterID,配件代码 HMaterNumber,配件名称 HMaterName,单位ID HUnitID,计量单位代码 HUnitNumber,计量单位名称 HUnitName,用量 HQty,子备注1 HRemark from h_v_Sc_MouldMaintainRuleBillSub where 1 = 1 " + Swhere + ""; |
| | |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | string msg5 = sArray[3].ToString(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | |
| | | List<Model.ClsSc_MouldMaintainRuleBillMain> lsmain = new List<Model.ClsSc_MouldMaintainRuleBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | |
| | | |
| | | //主表 |
| | | lsmain = oListModels.getObjectByJson_Sc_MouldMaintainRuleBillMain(msg2); |
| | | foreach (Model.ClsSc_MouldMaintainRuleBillMain oItem in lsmain) |
| | |
| | | return objJsonResult; |
| | | } |
| | | oBill.omodel = oItem; |
| | | |
| | | if (oItem.HInterID == 0) |
| | | { |
| | | // 判断新增的表单与表格中的表单是否有重复 |
| | | DataSet ds = oCN.RunProcReturn("select * from h_v_Sc_MouldMaintainRuleBillList where 单据号 = '" + oItem.HBillNo + "'", "h_v_Sc_MouldMaintainRuleBillList"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败!单据号不得有重复!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //保养项表体数据 |
| | | //按 },{来拆分数组 //去掉【和】 |
| | |
| | | int i = 0; |
| | | foreach (Model.ClsSc_MouldMaintainRuleBillSub_Item item in ls) |
| | | { |
| | | |
| | | i++; |
| | | item.HEntryID = i; |
| | | item.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | |
| | | //保存完毕后处理 |
| | | bool bResult; |
| | | if (oBill.omodel.HInterID == 0) |
| | | { |
| | | { |
| | | // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |