예제 #1
0
 def quitCourse(username, courseId):
     id = AccountDAO.getStudentIdByUserName(username)
     result = CourseDAO.quitCourse(id, courseId)
     return xmlutil.loginResultToXml({
         'success': result[0],
         'message': result[1]
     })
예제 #2
0
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)
예제 #3
0
    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])
        })
예제 #4
0
 def getNotLoginResult():
     return xmlutil.loginResultToXml({
         'success': unicode(False),
         'message': u'请先登录',
         'courses': []
     })