Sry.Solution.UI/SVC/delHandler.ashx.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Sry.Entity;
using Sry.Data;
using Sry.Framework.Web;
using Sry.Solution.Components;

namespace Sry.Solution.UI.SVC
{
    /// <summary>
    /// delHandler 的摘要说明
    /// </summary>
    public class delHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string result = String.Empty;
            HttpJsonResult<string> bRsp = new HttpJsonResult<string>();
            if (!String.IsNullOrEmpty(context.Request.Params["cmd"]))
            {
                Object o = context.Request.Params["id"]; 
                switch (context.Request.Params["cmd"].ToString())
                { 
                    
                    case "dept_delete":
                        Dept model6 = new Dept() { dep_ID = PublicMethod.ConvertTo<int>(o,0) };
                        //**判断该部门下是否还有用户
                        if (PublicMethod.judgeNum("Users", new List<string>(){"users_DepID"}, new List<string>(){o.ToString()}) > 0)
                        {
                            bRsp.IsError = true;
                            bRsp.SubErrorMsg = "该部门下还有用户,请先删除该部门下的用户";
                        }
                        else
                        {
                            if (new DeptData().Delete(model6, 0))
                                bRsp.IsError = false;
                            else
                            {
                                bRsp.IsError = true;
                                bRsp.SubErrorMsg = "删除失败";
                            }
                        }
                        break;
                    case "roles_delete":
                        #region 角色
		Roles model7 = new Roles() { roles_ID = PublicMethod.ConvertTo<int>(o, 0) };
                        if (PublicMethod.judgeNum("Users_Roles_Realations", new List<string>() { "urr_RolesID" }, new List<string>() { context.Request.Params["id"].ToString() }) > 0)
                            //**判断该角色下是否还有用户
                            if (PublicMethod.judgeNum("Users", new List<string>() { "users_DepID" }, new List<string>() { context.Request.Params["id"].ToString() }) > 0)
                            {
                                bRsp.IsError = true;
                                bRsp.SubErrorMsg = "该角色下还有用户,请先删除该角色下的用户";
                            }
                            else
                            {
                                //**删除角色表数据
                                //**删除用户角色对应表数据
后面还有 112 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。