Exemplo n.º 1
0
 /// <summary>
 /// 通过活动名称选择一个角色
 /// 角色名为空,返回所有角色
 /// </summary>
 /// <returns></returns>
 public List<Roles> GetAllRoleByRoleName(string roleName)
 {
     RolesDao ad = new RolesDao();
     Roles role = new Roles();
     role.Where = string.IsNullOrEmpty(roleName) ? "" : "LoweredRoleName = " + roleName.ToLower();
     return ad.Select(role);
 }
Exemplo n.º 2
0
        private List<Roles> ToListRoles(DataSet ds)
        {
            List<Roles> listRoles = new List<Roles>();
            DataTable dt = ds.Tables[0];
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                Roles rl = new Roles();
                rl.RoleId = dt.Rows[i]["RoleId"].ToString().ToInteger();
                rl.RoleName = dt.Rows[i]["RoleName"].ToString();
                rl.Description = dt.Rows[i]["Description"].ToString();

                listRoles.Add(rl);
            }
            return listRoles;
        }
Exemplo n.º 3
0
 /// <summary>
 /// 启用角色
 /// </summary>
 /// <param name="role"></param>
 /// <returns></returns>
 public int EnableRole(Roles role)
 {
     RolesDao rd = new RolesDao();
     role.Status = (int)DataStatusEnum.Enabled;
     return rd.Update(role);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 创建角色
 /// </summary>
 /// <param name="rs"></param>
 /// <returns></returns>
 public int CreateRole(Roles role)
 {
     RolesDao rd = new RolesDao();
     return rd.Insert(role);
 }
Exemplo n.º 5
0
 public bool EnableRole(Roles role)
 {
     return false;
 }
Exemplo n.º 6
0
 public bool DeleteRole(Roles role)
 {
     return true;
 }
Exemplo n.º 7
0
 public bool CreateRole(Roles role)
 {
     return true;
 }