| | |
| | | #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) |
| | | { |