Example #1
0
  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  private void userConnect() {
    //		Window.alert("Authorization.userConnect : login = "******", " +
    //                                                              (String)
    // accountForm.getValue(CONTROL_PASSWORD));
    //		System.out.println ("Authorization.userConnect - " + (String)
    // accountForm.getValue(CONTROL_LOGIN   ) + ", " +
    //                                                             (String)
    // accountForm.getValue(CONTROL_PASSWORD));
    GWTViewer.MapServiceInfoServlet.userConnect(
        (String) accountForm.getValue(CONTROL_LOGIN),
        (String) accountForm.getValue(CONTROL_PASSWORD),
        new AsyncCallback<String>() {
          public void onFailure(Throwable caught) {}

          public void onSuccess(String content) {
            //				System.out.println ("Authorization.userConnect - AsyncCallback.onSuccess : content
            // = " + content);
            //				Window.alert("Authorization.userConnect - AsyncCallback.onSuccess : content = " +
            // content + " => EastLine");
            if (content == null) labelException.setContents(ERROR_USER_NOT_FOUND);
            else
              //				{
              callback.onSuccess(content);
            //					closeForm();
            //				}
          }
        });
  }
Example #2
0
  private boolean updateBookInfo() {

    theBook.setBookName(bookForm1.getValueAsString("bookName"));
    theBook.setBookAuthor(bookForm1.getValueAsString("bookAuthor"));
    theBook.setBookISBN(bookForm1.getValueAsString("bookISBN"));
    theBook.setBookPublisher(bookForm1.getValueAsString("bookPublisher"));
    theBook.setBookPublishDate((Date) bookForm1.getValue("bookPublishDate"));
    theBook.setBookLanguage(bookForm1.getValueAsString("bookLanguage"));
    theBook.setBookPrice(Double.parseDouble((bookForm1.getValueAsString("bookPrice"))));
    theBook.setBookClass(bookForm1.getValueAsString("bookClass"));
    theBook.setBookContributor(bookForm1.getValueAsString("bookContributor"));
    theBook.setBookIntro(bookForm3.getValueAsString("bookIntro"));
    theBook.setBookTotalQuantity(Integer.parseInt(bookForm2.getValueAsString("bookTotalQuantity")));
    theBook.setBookInStoreQuantity(
        Integer.parseInt(bookForm2.getValueAsString("bookInStoreQuantity")));
    theBook.setBookAvailableQuantity(
        Integer.parseInt(bookForm2.getValueAsString("bookAvailableQuantity")));

    theBook.setBookPicUrl(strBookPicUrl);

    if (!FieldVerifier.isNotEmptyValid(theBook.getBookName())) {
      SC.say("请输入书名!");
      return false;
    }
    if (!FieldVerifier.isNotEmptyValid(theBook.getBookAuthor())) {
      SC.say("请输入作者!");
      return false;
    }
    if (!FieldVerifier.isNotEmptyValid(theBook.getBookISBN())) {
      SC.say("请输入书籍ISBN!");
      return false;
    }
    if (!FieldVerifier.isNotEmptyValid(theBook.getBookPublisher())) {
      SC.say("请输入出版商名称!");
      return false;
    }
    if (theBook.getBookPublishDate() == null) {
      SC.say("请输入出版日期!");
      return false;
    }
    if (!FieldVerifier.isNotEmptyValid(theBook.getBookLanguage())) {
      SC.say("请输入语言种类!");
      return false;
    }
    if (!FieldVerifier.isNotEmptyValid(theBook.getBookContributor())) {
      SC.say("请输入贡献者!");
      return false;
    }

    return true;
  }
Example #3
0
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 private boolean isEmpty() {
   String lg = (String) accountForm.getValue(CONTROL_LOGIN);
   String pw = (String) accountForm.getValue(CONTROL_PASSWORD);
   return (((lg == null) || ((lg != null) && (lg.trim().length() == 0)))
       || ((pw == null) || ((pw != null) && (pw.trim().length() == 0))));
 }