Ejemplo n.º 1
0
  /** 当修改公会名片成功后 去更新数据库里面的内容 */
  protected void modifyDatabase(String content) {
    GroupUserRelDao userRelDao =
        DaoFactory.getDaoFactory().getGroupUserRelDao(SystemContext.getInstance().getContext());
    GroupUserRelVo vo =
        userRelDao.findUsers(grid, SystemContext.getInstance().getExtUserVo().getUserid());
    if (vo == null) {
      ServiceFactory.getInstance()
          .getSyncListService()
          .syncList(
              SyncListService.TYPE_GROUP_USER,
              grid,
              new SyncCallBack() {

                @Override
                public void onSuccess(Object result) {}

                @Override
                public void onFailure(Integer result) {}
              });

    } else {
      vo.setRemark(content);
      userRelDao.insertOrUpdate(vo);
    }
  }
Ejemplo n.º 2
0
  /** 执行下面的这个 方法 修改我的公会名片 */
  protected void modifiyMyGroupCard(final String content) {
    if (content == null || "".equals(content)) {
      ToastUtil.showToast(EditGroupCardActivity.this, getString(R.string.group_card_not_null));
    } else if (content != null && content.trim().length() == 0) {
      ToastUtil.showToast(EditGroupCardActivity.this, getString(R.string.group_card_not_space));
    } else if (ServiceFactory.getInstance().getWordsManager().matchName(content)) {
      ToastUtil.showToast(this, this.getResources().getString(R.string.global_words_error));
    } else {
      dialog.dismiss();
      final CustomProgressDialog customProgressDialog = CustomProgressDialog.createDialog(this);
      customProgressDialog.show();
      ProxyFactory.getInstance()
          .getUserProxy()
          .userAction(
              new ProxyCallBack<Integer>() {

                @Override
                public void onSuccess(Integer result) {
                  modifyDatabase(content);
                  // 弹出提示语,修改textview里面的内容
                  oriContent = content;
                  groupcard.setText(content);
                  customProgressDialog.dismiss();
                  Intent intent = new Intent();
                  intent.putExtra(
                      SystemConfig.GROUP_CARD_CONTENT_KEY, groupcard.getText().toString());
                  setResult(20, intent);
                  // 获取到我与公会之间的关系
                  GroupUserRelVo groupUserRelVo =
                      ProxyFactory.getInstance()
                          .getGroupProxy()
                          .getRel(grid, SystemContext.getInstance().getExtUserVo().getUserid());
                  groupUserRelVo.setRemark(groupcard.getText().toString().trim());
                  dao.insertOrUpdate(groupUserRelVo);
                }

                @Override
                public void onFailure(Integer result, String resultMsg) {
                  ErrorCodeUtil.handleErrorCode(EditGroupCardActivity.this, result, resultMsg);
                  customProgressDialog.dismiss();
                }
              },
              EditGroupCardActivity.this,
              grid,
              5,
              165,
              content.trim(),
              null,
              null);
    }
  }