def quitCourse(username, courseId): id = AccountDAO.getStudentIdByUserName(username) result = CourseDAO.quitCourse(id, courseId) return xmlutil.loginResultToXml({ 'success': result[0], 'message': result[1] })
def login(): username = request.form['username'] password = request.form['password'] loginResult = AccountService.login(username, password) if (loginResult['success']): session['isLogin'] = True session['username'] = username else: session['isLogin'] = False session['username'] = None return xmlutil.loginResultToXml(loginResult)
def wsQuitCourse(username, courseId, courseDept): result = None id = AccountDAO.getStudentIdByUserName(username) if (courseDept == departmentId): result = CourseDAO.quitCourse(id, courseId) else: result = CourseWebService.__wsQuitCourse(id, departmentId, courseId, courseDept) return xmlutil.loginResultToXml({ 'success': unicode(result[0]), 'message': unicode(result[1]) })
def getNotLoginResult(): return xmlutil.loginResultToXml({ 'success': unicode(False), 'message': u'请先登录', 'courses': [] })