| | |
| | | { |
| | | try |
| | | { |
| | | DAL.ClsGy_WorkCenter_Ctl oDept = new DAL.ClsGy_WorkCenter_Ctl(); |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | string msg5 = sArray[3].ToString(); |
| | | //反序列化 |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Gy_WorkCenter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkCenter>>(msg2); |
| | | long HItemID = int.Parse(msg3); |
| | | msg1 = "[" + msg1.ToString() + "]"; |
| | | DAL.ClsGy_WorkCenter_Ctl oDept = new DAL.ClsGy_WorkCenter_Ctl(); |
| | | List<Gy_WorkCenter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkCenter>>(msg1); |
| | | |
| | | long HItemID = list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID; |
| | | long HParentID = list[0].HParentID; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | string HStopflag = list[0].HStopflag; |
| | |
| | | var HWorkTimes = list[0].HWorkTimes; |
| | | |
| | | //判断权限 |
| | | if (!ClsPub.Security_Log(msg5, 1, true, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有找到该功能模块!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代码中不能出现连续‘.’并且首位末位不能为‘.’!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代码重复!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //if (!ClsPub.Security_Log(msg5, 1, true, msg4)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "没有找到该功能模块!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代码中不能出现连续‘.’并且首位末位不能为‘.’!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代码重复!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //若MAINDI重复则重新获取 |
| | | oCN.BeginTran(); |
| | | //主表 |
| | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 维修列表修改按钮方法 |
| | | /// 工作中心列表修改按钮方法 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_WorkCenter where HItemID=" + HInterID, "Gy_WorkCenter"); |
| | | ds = oCN.RunProcReturn("select a.*,b.HName HDeptName from Gy_WorkCenter a left join Gy_Department b on a.HDeptID = b.HItemID where a.HItemID=" + HInterID, "Gy_WorkCenter"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |