Ejemplo n.º 1
0
        /// <summary>
        ///     保存用户的教育经历
        /// </summary>
        /// <param name="userEdus"></param>
        public void SaveUserEduList(List <SysUserEdu> userEdusList)
        {
            if (userEdusList.Count == 0)
            {
            }
            string deleteWhere = "UserId=" + userEdusList[0].UserId;

            _dataAccess.DeleteEntities <SysUserEdu>(deleteWhere);
            _dataAccess.AddEntities(userEdusList);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     添加一组用户到一组角色
        /// </summary>
        /// <param name="userIds"></param>
        /// <param name="roleIds"></param>
        public void AddUsersToRoles(int[] userIds, int[] roleIds)
        {
            var roleUsers = new List <SysRoleUser>(userIds.Length * roleIds.Length);

            foreach (int t in userIds)
            {
                if (t == 0)
                {
                    continue;
                }
                roleUsers.AddRange(roleIds.Where(p => p != 0).Select(t1 => new SysRoleUser {
                    RoleId = t1, UserId = t
                }));
            }
            _dataAccess.DeleteEntities <SysRoleUser>(" Sys_RoleUser.UserId IN (" + userIds.GetString() + ")");

            _dataAccess.AddEntities(roleUsers);
        }
Ejemplo n.º 3
0
 public void AddPosts(List <SysPost> posts)
 {
     _dataAccess.AddEntities(posts);
 }
Ejemplo n.º 4
0
 public void AddDepts(List <SysDepartment> depts)
 {
     _dataAccess.AddEntities(depts);
 }