Пример #1
0
def book_detail(request):
    service = library_service.LibraryService()

    try:
        marc_no = request.GET["marc_no"]
    except Exception, e:
        return HttpResponse(REQUEST_PARAMS_ERROR)
Пример #2
0
def check_render_books(request):
    try:
        username = request.POST["username"]
        passwd = request.POST["password"]
    except:
        return HttpResponse(REQUEST_POST_ERROR)

    service = library_service.LibraryService(username, passwd)
    try:
        books = service.get_render_book_list()
    except custom_exception.LoginException:
        return HttpResponse(ACOUNT_ERROR)
    except Exception, e:
        config.logger.error(e)
        return HttpResponse(SERVER_ERROR)
Пример #3
0
def renew_book(request):
    try:
        username = request.POST["username"]
        passwd = request.POST["password"]
        barcode = request.POST["barcode"]
    except:
        return HttpResponse(REQUEST_POST_ERROR)

    service = library_service.LibraryService(username, passwd)
    try:
        result = service.renew_book(barcode)
    except custom_exception.LoginException:
        return HttpResponse(ACOUNT_ERROR)
    except Exception, e:
        config.logger.error(e)
        return HttpResponse(SERVER_ERROR + str(e))
Пример #4
0
def cancel_appoint(request):
    try:
        username = request.POST["username"]
        passwd = request.POST["password"]
        call_no = request.POST["call_no"]
        marc_no = request.POST["marc_no"]
        loca = request.POST["loca"]
    except:
        return HttpResponse(REQUEST_POST_ERROR)

    service = library_service.LibraryService(username, passwd)
    try:
        result = service.cancel_appoint(call_no, marc_no, loca)
    except custom_exception.LoginException:
        return HttpResponse(ACOUNT_ERROR)
    except Exception, e:
        config.logger.error(e)
        return HttpResponse(SERVER_ERROR)
Пример #5
0
def appoint_info(request):
    try:
        username = request.POST["username"]
        passwd = request.POST["password"]
        marc_no = request.POST['marc_no']
    except:
        return HttpResponse(REQUEST_PARAMS_ERROR)

    service = library_service.LibraryService(username, passwd)
    try:
        detail = service.get_appoint_book_info(marc_no)
        #detail = service.get_appoint_book_info('0000519601')
        print detail
    except custom_exception.LoginException:
        return HttpResponse(ACOUNT_ERROR)
    except Exception, e:
        #print e
        config.logger.error(e)
        return HttpResponse(SERVER_ERROR)
Пример #6
0
def appoint_book(request):
    try:
        #callnol, location, check, take_loca='90001'
        username = request.POST["username"]
        passwd = request.POST["password"]
        call_no = request.POST["call_no"]
        location = request.POST["location"]
        check = request.POST["check"]
        take_loca = request.POST['take_loca']
    except:
        return HttpResponse(REQUEST_POST_ERROR)

    service = library_service.LibraryService(username, passwd)
    try:
        result = service.appoint_book(call_no, location, check, take_loca)
    except custom_exception.LoginException:
        return HttpResponse(ACOUNT_ERROR)
    except Exception, e:
        print e
        config.logger.error(e)
        return HttpResponse(SERVER_ERROR)
Пример #7
0
def search_book(request):
    service = library_service.LibraryService()
    try:
        strText = request.GET["strText"]
    except Exception, e:
        return HttpResponse(REQUEST_PARAMS_ERROR)
Пример #8
0
def check_account(request):
    username = request.POST['username']
    pwd = request.POST['password']
    service = library_service.LibraryService(username, pwd)
    status = service.check_account()
    return HttpResponse(str(status))