예제 #1
0
    public string ResetRoleAction(string depts, string roles)
    {
        if (this._.设置部门角色.Permit == 0)
        {
            return("您没有进行设置部门角色的权限!");
        }
        string             Result = string.Empty;
        List <SspDeptRole> lst    = new List <SspDeptRole>();

        string[] deptList = depts.Split('|');

        int irole = 0;

        if (!int.TryParse(GetRequest("RoleID"), out irole))
        {
            return("请选择角色");
        }
        string[] roleList = roles.Split('|');
        foreach (string dept in deptList)
        {
            if (string.IsNullOrWhiteSpace(dept))
            {
                continue;
            }
            sysDeptRoleManager.Delete(new SspDeptRole()
            {
                RoleId = irole, DeptId = Convert.ToInt32(dept)
            });
        }
        foreach (string dept in roleList)
        {
            if (string.IsNullOrWhiteSpace(dept))
            {
                continue;
            }
            SspDeptRole m = new SspDeptRole();
            m.DeptId       = Convert.ToInt32(dept);
            m.RoleId       = irole;
            m.RecordUserId = this.Data.User.UserId;
            lst.Add(m);
        }
        sysDeptRoleManager.BatchInsert(lst);
        return(Result);
    }
예제 #2
0
 public int GetRowCount(SspDeptRole entity)
 {
     return(this.basicService.GetRowCount(entity));
 }
예제 #3
0
 public int Delete(SspDeptRole entity)
 {
     return(this.basicService.Delete(entity));
 }
예제 #4
0
 public IList <SspDeptRole> GetEntityList(SspDeptRole entity)
 {
     return(this.basicService.GetEntityList(entity));
 }