Exemple #1
0
 /**
  * 保存本地事件
  *
  * @param event 事件
  * @param cid 日历ID
  * @param calendarAccount 日历帐号
  * @return
  * @throws Exception
  */
 public FDEvent saveGo2Events(FDEvent event, FDCalendar cal) throws Exception {
   Map<String, String> params = new HashMap<String, String>();
   params.put("method", "add");
   params.put("title", event.getTitle());
   params.put("description", event.getNote());
   params.put("start", FDTimeFormatUtil.sdfAllDate.format(event.getFromDateByTimeZone()));
   params.put("timezone", event.getTimezone());
   params.put("end", FDTimeFormatUtil.sdfAllDate.format(event.getToDateByTimeZone()));
   params.put("isAllDay", event.isAllDay() ? "1" : "0");
   params.put("location", event.getLocation());
   params.put("cid", event.getCalendarId());
   params.put("recurrence", event.getRecurrence());
   params.put("recurringEventId", event.getRecurringEventId());
   params.put("status", event.getStatus() + "");
   params.put("originalStartTime", event.getOriginalStartTime());
   FDEvent receiveEvent = null;
   FDJson json = sendPOSTRequestByJson("user/privateEvent", params);
   if (json != null) {
     if (json.getStatusCode() != 1) {
       return null;
     }
     receiveEvent = new FDEvent(json.getData(), cal, FDCalendarAccount.TYPE_GO2);
   }
   return receiveEvent;
 }
 /** 初始化时区按钮 */
 private void initTimeZoneButton() {
   etTimeZone.setText(event != null ? event.getTimezone() : TimeZone.getDefault().getID());
   etTimeZone.setInputType(InputType.TYPE_NULL);
   etTimeZone.setOnClickListener(
       new OnClickListener() {
         public void onClick(View v) {
           Intent intent = new Intent(AddPersonEventActivity.this, SelectTimeZoneActivity.class);
           startActivityForResult(intent, BACK_REQUEST_CODE_SELECTE_TIME_ZONE);
         }
       });
 }