{
__pPm->SetAllDayEvent(false);
- DateTime startTime;
- startTime.SetValue(__pEditDateStartDate->GetYear(), __pEditDateStartDate->GetMonth(), __pEditDateStartDate->GetDay(),
- __pEditTimeStartTime->GetHour(), __pEditTimeStartTime->GetMinute());
- DateTime endTime;
- endTime.SetValue(__pEditDateEndDate->GetYear(), __pEditDateEndDate->GetMonth(), __pEditDateEndDate->GetDay(),
- __pEditTimeEndTime->GetHour(), __pEditTimeEndTime->GetMinute());
- if (startTime >= endTime)
+ if (__pEditDateStartDate != null && __pEditTimeStartTime != null
+ && __pEditDateEndDate != null && __pEditTimeEndTime != null)
{
- endTime.AddHours(1);
- }
- __pPm->SetStartEndTime(startTime, endTime);
+ DateTime startTime;
+ startTime.SetValue(__pEditDateStartDate->GetYear(), __pEditDateStartDate->GetMonth(), __pEditDateStartDate->GetDay(),
+ __pEditTimeStartTime->GetHour(), __pEditTimeStartTime->GetMinute());
+ DateTime endTime;
+ endTime.SetValue(__pEditDateEndDate->GetYear(), __pEditDateEndDate->GetMonth(), __pEditDateEndDate->GetDay(),
+ __pEditTimeEndTime->GetHour(), __pEditTimeEndTime->GetMinute());
+ if (startTime >= endTime)
+ {
+ endTime.AddHours(1);
+ }
+ __pPm->SetStartEndTime(startTime, endTime);
- if (__pEditTimeStartTime != null)
- {
__pEditTimeStartTime->SetTime(__pPm->GetStartTime());
__pEditTimeStartTime->SetShowState(true);
__pEditTimeStartTime->Invalidate(false);
- }
- if (__pEditTimeEndTime != null)
- {
__pEditTimeEndTime->SetTime(__pPm->GetEndTime());
__pEditTimeEndTime->SetShowState(true);
__pEditTimeEndTime->Invalidate(false);
result r = __pPm->SetEventId(eventId);
if (r != E_SUCCESS)
{
- if (pArgs != null)
- {
- pArgs->RemoveAll(true);
- delete pArgs;
- }
-
const String* pReturnResult = pApp->GetArgument(KEY_DATA_RETURN_RESULT);
if (pReturnResult != null && pReturnResult->Equals(L"true", false) == true)
{
__pCalendarbook = new (std::nothrow) Calendarbook();
__pCalendarbook->Construct();
- SetEventId(eventId);
+ result r = SetEventId(eventId);
+ TryCatch(r == E_SUCCESS, , "[%s] Unable to construct EventPresentationModel.", GetErrorMessage(r));
__pDateFormatter = ResourceManager::CreateDateFormatterN(Locales::DATE_TIME_STYLE_LONG);
__pDateTimeFormatter = ResourceManager::CreateDateTimeFormatterN(Locales::DATE_TIME_STYLE_LONG);
__pTimeFormatter = ResourceManager::CreateTimeFormatterN();
return E_SUCCESS;
+CATCH:
+ delete __pCalendarbook;
+ __pCalendarbook = null;
+ return r;
}
String