Пример #1
0
        /// <summary>
        /// 删除注册信息
        /// 删除申请信息
        /// 删除引用关联(团队成员、团队)
        /// </summary>
        /// <returns></returns>
        public string deleteUser()
        {
            string userid = Request["usercode"];
            UserManage um = new UserManage();
            ApplyManage am = new ApplyManage();
            TeamManage tm = new TeamManage();
            bool judge = false;
            if(!tm.deleteTeamMemberByUserid(userid))
            {
                return @"无法删除该用户在团队的信息";
            }
            if(!tm.deleteTeamByTeamLeaderUsercode(userid))
            {
                return @"该用户是队伍创建者,需要先删除其队伍所有信息";
            }
            if(!am.DeleteApplyByUserID(userid))
            {
                return @"无法删除该用户的申请信息";
            }

            judge = um.DeleteUserByUserCode(userid);
            if(judge)
            {
                return  @"删除成功";
            }
            else
            {
                return  @"删除失败";
            }
        }