@Override protected void onGo(ComponentContainer container, ScreenData<?> data) { if (AppContext.canWrite(RolePermissionCollections.CRM_MEETING)) { MeetingWithBLOBs meeting = null; if (data.getParams() instanceof MeetingWithBLOBs) { meeting = (MeetingWithBLOBs) data.getParams(); } else if (data.getParams() instanceof Integer) { MeetingService meetingService = ApplicationContextUtil.getSpringBean(MeetingService.class); meeting = meetingService.findByPrimaryKey((Integer) data.getParams(), AppContext.getAccountId()); } if (meeting == null) { NotificationUtil.showRecordNotExistNotification(); return; } super.onGo(container, data); view.editItem(meeting); if (meeting.getId() == null) { AppContext.addFragment( "crm/activity/meeting/add/", AppContext.getMessage(GenericI18Enum.BROWSER_ADD_ITEM_TITLE, "Meeting")); } else { AppContext.addFragment( "crm/activity/meeting/edit/" + UrlEncodeDecoder.encode(meeting.getId()), AppContext.getMessage( GenericI18Enum.BROWSER_EDIT_ITEM_TITLE, "Meeting", meeting.getSubject())); } } else { NotificationUtil.showMessagePermissionAlert(); } }
public void save(MeetingWithBLOBs item) { MeetingService meetingService = ApplicationContextUtil.getSpringBean(MeetingService.class); item.setSaccountid(AppContext.getAccountId()); if (item.getId() == null) { meetingService.saveWithSession(item, AppContext.getUsername()); } else { meetingService.updateWithSession(item, AppContext.getUsername()); } }