Example #1
0
 private static GUID parseGUID(TString guid) {
   try {
     return GUID.valueOf(guid.value);
   } catch (ValueConvertException vce) {
     throw new SQLValueFormatException(guid.line, guid.col, "GUID格式不正确 '" + guid.value + "'");
   }
 }
  /** 指定操作发生时,触发的事件 */
  public void actionPerformed(String rowId, String actionName, String actionValue) {
    //		if (ID_ACTION_EDIT.equals(actionName)) {
    PageController pc =
        new PageController(GoodsSplitDetailProcessor.class, GoodsSplitDetailRender.class);
    PageControllerInstance pci = new PageControllerInstance(pc, GUID.valueOf(rowId));
    MsgRequest request = new MsgRequest(pci, "拆分单");
    request.setResponseHandler(
        new ResponseHandler() {

          public void handle(
              Object returnValue, Object returnValue2, Object returnValue3, Object returnValue4) {
            table.render();
          }
        });
    getContext().bubbleMessage(request);
    //		}
    //		else if (Action.Submit.name().equals(actionName)) {
    //			UpdateGoodsSplitStatusTask task = new UpdateGoodsSplitStatusTask(GUID.valueOf(rowId),
    // GoodsSplitStatus.Approvaling);
    //			getContext().handle(task);
    //			table.render();
    //		}
    //		else if (Action.Delete.name().equals(actionName)) {
    //			confirm("确定要删除吗?", new Runnable() {
    //
    //				public void run() {
    //					DeleteGoodsSplitBillTask task = new DeleteGoodsSplitBillTask(GUID.valueOf(rowId));
    //					getContext().handle(task);
    //					table.render();
    //				}
    //			});
    //
    //		}
  }
 private void share(String... ids) {
   if (!checkSelection(ids)) {
     return;
   }
   for (String id : ids) {
     getContext().handle(new UpdateCustomerSalesManTask(GUID.valueOf(id)));
   }
   PotentialCustomerListProcessor.this.hint("设置成功");
   table.render();
 }
 public Object getElementById(String id) {
   if (null == id) {
     return null;
   } else if (id.equals("")) {
     if (rootNodeId != null) return treeData.getNodeById(rootNodeId);
     return treeData;
   } else {
     return treeData.getNodeById(GUID.tryValueOf(id));
   }
 }
Example #5
0
 @Override
 public final Object inGUID(TUserData userData) throws SQLException {
   GUID value = GUID.valueOf(this.resultSet.getBytes(this.jdbcIndex));
   if (value == null) {
     this.readNull(userData);
     return null;
   } else {
     this.readGUID(userData, value);
     return value;
   }
 }
Example #6
0
 static final GUID generateGroupACIdentifier(
     final String resourceServiceName, final Class<?> facadeClass, final Object spaceIdentifier) {
   // final String facadeClassName = facadeClass.getName();
   if (isPreservedSpaceIdentifier(spaceIdentifier)) {
     return GUID.MD5Of(resourceServiceName);
   } else if (spaceIdentifier.getClass() == GUID.class) {
     return (GUID) spaceIdentifier;
   } else if (spaceIdentifier.getClass() == String.class) {
     return GUID.MD5Of(resourceServiceName + ":" + spaceIdentifier);
   } else if (spaceIdentifier instanceof Enum<?>) {
     return GUID.MD5Of(
         resourceServiceName
             + ":"
             + spaceIdentifier.getClass().getName()
             + "."
             + ((Enum<?>) spaceIdentifier).name());
   } else {
     throw new IllegalArgumentException("非法的缓存组空间标识。");
   }
 }
 /** 组装公告对像 */
 private SaveOrUpdateNoticeTask buildSaveOrUpdateNoticeTask() {
   SaveOrUpdateNoticeTask saveOrUpdateNoticeTask = new SaveOrUpdateNoticeTask();
   if (null == getArgument()) {
     // 公告GUID
     saveOrUpdateNoticeTask.setRECID(getContext().newRECID());
     // 创建日期
     saveOrUpdateNoticeTask.setCreateDate(new Date().getTime());
   } else {
     // 公告GUID
     saveOrUpdateNoticeTask.setRECID(((NoticeInfo) this.getArgument()).getRECID());
     // 创建日期
     saveOrUpdateNoticeTask.setCreateDate(((NoticeInfo) this.getArgument()).getCreateTime());
   }
   // 公告标题
   saveOrUpdateNoticeTask.setNoticeTitle(
       noticeTitleText.getText() != null ? noticeTitleText.getText().trim() : "");
   // 是否置顶
   saveOrUpdateNoticeTask.setIsTop(isTopCheckBox.getSelection());
   // 发布范围
   saveOrUpdateNoticeTask.setDeptNameStr(
       deptNameStrText.getText() != null ? deptNameStrText.getText().trim() : "");
   // 发布日期
   saveOrUpdateNoticeTask.setPublishTime(
       publishingDate.getDate() != null ? publishingDate.getDate().getTime() : 0);
   // 撤消日期
   saveOrUpdateNoticeTask.setCancelTime(
       cancelDate.getDate() != null ? DateUtil.getDayEndTime(cancelDate.getDate().getTime()) : 0);
   // 公告内容
   saveOrUpdateNoticeTask.setNoticeContent(
       noticeContentText.getContent() != null ? noticeContentText.getContent().trim() : "");
   // 发布范围
   if (StringHelper.isNotEmpty(deptGuidStr)) {
     String[] deptGuids = deptGuidStr.split(",");
     List<GUID> deptGuidList = new ArrayList<GUID>();
     if (null != deptGuids && deptGuids.length > 0) {
       for (Object item : deptGuids) {
         deptGuidList.add(GUID.valueOf(item.toString()));
       }
     }
     saveOrUpdateNoticeTask.setDeptGuidList(deptGuidList);
   }
   return saveOrUpdateNoticeTask;
 }
 private void edit(String customerId) {
   //
   BaseFunction[] functions =
       new BaseFunction[] {
         new BaseFunction(
             new PageControllerInstance(
                 new PageController(EditCustomerProcessor.class, EditCustomerRender.class),
                 GUID.valueOf(customerId)),
             "客户信息")
       };
   MsgRequest request = new MsgRequest(functions, "客户详情");
   request.setResponseHandler(
       new ResponseHandler() {
         public void handle(
             Object returnValue, Object returnValue2, Object returnValue3, Object returnValue4) {
           table.render();
         }
       });
   getContext().bubbleMessage(request);
 }
  @Override
  public void actionPerformed(String rowId, String actionName, String actionValue) {
    if (Action.Detail.name().equals(actionName) || Action.Approval.name().equals(actionName)) {
      PageController pc =
          new PageController(
              OnlineReturnSheetDetailProcessor.class, OnlineReturnSheetDetailRender.class);
      PageControllerInstance pci =
          new PageControllerInstance(
              pc, GUID.tryValueOf(rowId), OnlineReturnSheetDetailProcessor.Type.Detail);
      MsgRequest request = new MsgRequest(pci, "ÍøÉÏÍË»õµ¥ÏêÇé");
      request.setResponseHandler(
          new ResponseHandler() {

            public void handle(
                Object returnValue, Object returnValue2, Object returnValue3, Object returnValue4) {
              table.render();
            }
          });
      getContext().bubbleMessage(request);
    }
  }
  /** 行对像指定操作发生时,触发的事件 */
  @Override
  public void actionPerformed(final String rowId, String actionName, String actionValue) {
    if (actionName.equals(Action.Delete.name())) { // 删除公告
      confirm(
          "确认删除当前公告?",
          new Runnable() {

            public void run() {
              DeleteNoticeTask deleteNoticeTask = new DeleteNoticeTask();
              deleteNoticeTask.setRECID(GUID.valueOf(rowId));
              getContext().handle(deleteNoticeTask);
              hint("删除成功!");
              table.render();
            }
          });
    } else if (ID_ACTION_EDIT.equals(actionName)) { // 编辑公告
      WindowStyle style = new WindowStyle(JWT.CLOSE | JWT.MODAL);
      style.setSize(750, 500);
      FindNoticeInfoKey findNoticeInfoKey = new FindNoticeInfoKey();
      findNoticeInfoKey.setRECID(GUID.valueOf(rowId));
      NoticeInfo noticeInfo = getContext().get(NoticeInfo.class, findNoticeInfoKey);
      PageControllerInstance controllerInstance =
          new PageControllerInstance("addNoticePage", noticeInfo);
      MsgRequest request = new MsgRequest(controllerInstance, "编辑公告", style);
      // 回应
      request.setResponseHandler(
          new ResponseHandler() {

            public void handle(
                Object returnValue, Object returnValue2, Object returnValue3, Object returnValue4) {
              hint("保存成功!在发布日,系统将自动发布该公告。");
              table.render();
            }
          });
      getContext().bubbleMessage(request);
    }
  }