| | |
| | | |
| | | if (OperationType == 1)//新增 |
| | | { |
| | | //新增前查询 确保角色名未重复新增 |
| | | ds = oCN.RunProcReturn("Select * from System_UserGroup where GroupName='" + omdelMian.GroupName + "'", "System_UserGroup"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "角色新增失败!当前角色名已经存在,不可重复"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //主表 |
| | | oCN.RunProc("insert into System_UserGroup (GroupName,HLev,Explain)values" + |
| | | $"('{omdelMian.GroupName}','{omdelMian.HLev}','{omdelMian.Explain}')"); |
| | |
| | | } |
| | | else if (OperationType == 2)//复制 |
| | | { |
| | | //新增前查询 确保角色名未重复新增 |
| | | ds = oCN.RunProcReturn("Select * from System_UserGroup where GroupName='" + omdelMian.GroupName + "'", "System_UserGroup"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "角色新增失败!当前角色名已经存在,不可重复"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string realExplain = omdelMian.Explain.Substring(0, omdelMian.Explain.IndexOf("#复制原角色ID:")); //获取界面设置的Explain值 |
| | | string sourceBill_GroupID = omdelMian.Explain.Replace(realExplain + "#复制原角色ID:", ""); //获取复制的源单据的ID |
| | | omdelMian.Explain = realExplain; |