Esempio n. 1
0
DateTime IRailAPI::getDateTime(String &isoTime){
	String year_, month_, day_, hours_, minutes_, seconds_;
	int year, month, day, hours, minutes;
	//substrings
	isoTime.SubString(0, 4, year_);
	isoTime.SubString(5, 2, month_);
	isoTime.SubString(8, 2, day_);
	isoTime.SubString(11, 2, hours_);
	isoTime.SubString(14, 2, minutes_);
	//parsing
	Integer::Parse(year_, year);
	Integer::Parse(month_, month);
	Integer::Parse(day_, day);
	Integer::Parse(hours_, hours);
	Integer::Parse(minutes_, minutes);
	DateTime dt;
	dt.SetValue(year, month, day, hours, minutes);

	//NO NEED FOR Localisation here
	/*
	LocaleManager localeManager;
	localeManager.Construct();
	TimeZone t= localeManager.GetSystemTimeZone();
	int utcDifference = t.GetRawOffset();
	dt->AddMinutes(utcDifference);
	*/
	return dt;
}
Esempio n. 2
0
void Chatting::AddDataToChattControl() {
	DateTime timeSend;

	String strText;
	Bitmap* strBitmap;

	timeSend.SetValue(2014, 7, 30, 9, 12, 4);
	int nTimeGap = 4;
	AppResource* pAppResource = Application::GetInstance()->GetAppResource();
/*
	 for(int i=0 ; i < 10 ; i++) {

	 strText.Format(200, L"%d번이나 시도를 하지. ", i+1);
	 __pChattControl->AddDataText(timeSend, strText, true);
	 //timeSend.AddMinutes(nTimeGap);
	 timeSend.AddHours(nTimeGap);

	 strText = L"지금은 몇시고 난 누구고 여기는 어딘가 ㅎㅎㅎㅎㅎㅎㅎㅎㅎㅎㅎㅎㅎ";
	 __pChattControl->AddDataText(timeSend, strText, false);
	 //timeSend.AddMinutes(nTimeGap);
	 timeSend.AddHours(nTimeGap);

	 strText = L"타이젠은 제대로 구축되어 있는게 하나도 없다. 그래서 화가 난다. 내가 하나부터 열까지 다해야 한다 ㅠㅠ";
	 __pChattControl->AddDataText(timeSend, strText, true);
	 //timeSend.AddMinutes(nTimeGap);
	 timeSend.AddHours(nTimeGap);

	 strText = L"동해물과 백두산이 마르고 닳도록 하느님이 보우하사 우리나라만세";
	 __pChattControl->AddDataText(timeSend, strText, true);
	 //timeSend.AddMinutes(nTimeGap);
	 timeSend.AddHours(nTimeGap);

	 strBitmap = pAppResource->GetBitmapN(L"voice_pb1.png");
	 __pChattControl->AddDataImage(timeSend, strBitmap, false);
	 //timeSend.AddMinutes(nTimeGap);
	 timeSend.AddHours(nTimeGap);

	 strText = L"후아 ㅎㅎ";
	 __pChattControl->AddDataText(timeSend, strText, true);
	 //timeSend.AddMinutes(nTimeGap);
	 timeSend.AddHours(nTimeGap);

	 strText = L"음성 피드백이나 해라";
	 __pChattControl->AddDataText(timeSend, strText, false);
	 //timeSend.AddMinutes(nTimeGap);
	 timeSend.AddHours(nTimeGap);
	 }

*/


		 __pChattControl->AddDataFeedback(timeSend, L"Hello",false);
		 timeSend.AddHours(nTimeGap);

	 __pChattControl->RequestRedraw();

}
result ForUsDocForm::OnInitializing(void) {

	DateTime CurDateTime;
	SetFormBackEventListener(this);

	result r = SystemTime::GetCurrentTime(CurDateTime);
	TryReturn(!IsFailed(r), r,
			"SystemTime::GetCurrentTime() failed with [%s]", GetErrorMessage(r));

	r = CurDateTime.SetValue(CurDateTime.GetYear(), CurDateTime.GetMonth(), 1);
	TryReturn(!IsFailed(r), r,
			"DateTime::SetValue() failed with [%s]", GetErrorMessage(r));

	__pSelectCalendar = Calendar::CreateInstanceN();
	TryReturn(__pSelectCalendar != null, E_SYSTEM,
			"Unable to get Create Instance");

	r = __pSelectCalendar->SetTime(CurDateTime);
	TryReturn(!IsFailed(r), r,
			"Calendar::SetTime() failed with [%s]", GetErrorMessage(r));

	AppLog(
			"GetCurrentTime : %d/%d/%d", __pSelectCalendar->GetTimeField(TIME_FIELD_YEAR), __pSelectCalendar->GetTimeField(TIME_FIELD_MONTH), __pSelectCalendar->GetTimeField(TIME_FIELD_DAY_OF_MONTH));

	r = InitializeActionControls();
	TryReturn(!IsFailed(r), r,
			"InitializeActionControls() failed with [%s]", GetErrorMessage(r));

	r = InitializeDayNumberButtons();
	TryReturn(!IsFailed(r), r,
			"InitializeDayNumberButtons() failed with [%s]", GetErrorMessage(r));

	TryReturn(UpdateCalendarDisplay() == true, E_SYSTEM,
			"UpdateCalendarDisplay() failed");

	return E_SUCCESS;
}
Esempio n. 4
0
result
EditEventForm::UpdateEvent(void)
{
	result r = E_SUCCESS;

	// Sets the Subject
	String strValue = __pSubjectEditField->GetText();
	if (strValue.IsEmpty() == false)
	{
		__pCalEvent->SetSubject(strValue);
	}

	// Sets the Location
	__pCalEvent->SetLocation(__pLocationEditField->GetText());

	// Sets the Description
	__pCalEvent->SetDescription(__pDescriptionEditField->GetText());

	// Sets the Priority
	__pCalEvent->SetPriority(__selectedPriority);

	// Sets the Sensitivity
	__pCalEvent->SetSensitivity(__selectedSensitivity);

	// Sets the Status
	__pCalEvent->SetStatus(__selectedStatus);

	// Gets the Time zone.
	LocaleManager localeManager;
	localeManager.Construct();

	TimeZone timeZone = localeManager.GetSystemTimeZone();
	__pCalEvent->SetTimeZone(timeZone);

	DateTime startDate;
	DateTime endDate;

	__pCalEvent->SetRecurrence(null);

	if (__pIsAllDayButton->IsSelected() == true)
	{
		__pCalEvent->SetAllDayEvent(true);

		startDate = __pStartEditDate->GetDate();
		endDate = __pEndEditDate->GetDate();
		endDate.AddDays(1);

		__pCalEvent->SetStartAndEndTime(startDate, endDate);
	}
	else
	{
		__pCalEvent->SetAllDayEvent(false);
		startDate.SetValue(__pStartEditDate->GetYear(), __pStartEditDate->GetMonth(), __pStartEditDate->GetDay(), __pStartEditTime->GetHour(), __pStartEditTime->GetMinute(), 0);
		endDate.SetValue(__pEndEditDate->GetYear(), __pEndEditDate->GetMonth(), __pEndEditDate->GetDay(), __pEndEditTime->GetHour(), __pEndEditTime->GetMinute(), 0);
		__pCalEvent->SetStartAndEndTime(timeZone.WallTimeToUtcTime(startDate), timeZone.WallTimeToUtcTime(endDate));
	}

	// Sets the Reminder
	const IList& pReminderList = __pCalEvent->GetAllReminders();
	if (pReminderList.GetCount() > 0)
	{
		__pCalEvent->RemoveReminderAt(0);
	}

	strValue = __pReminderEditField->GetText();
	if (strValue.IsEmpty() == false)
	{
		int timeOffset = 0;
		Integer::Parse(strValue, timeOffset);
		if (timeOffset > 0)
		{
			Reminder reminder;
			reminder.SetTimeOffset(__selectedReminder, timeOffset);
			__pCalEvent->AddReminder(reminder);
		}
	}

	// Sets the Recurrence
	if (__pRecurrence != null)
	{
		const DateTime* pUntilDate = __pRecurrence->GetUntil();
		if (pUntilDate && __pCalEvent->IsAllDayEvent() == false)
		{
			DateTime utcTime = timeZone.WallTimeToUtcTime(*pUntilDate);
			__pRecurrence->SetUntil(&utcTime);
		}
		r = __pCalEvent->SetRecurrence(__pRecurrence);
		TryCatch(!IsFailed(r), , "[%s] Failed to set recurrence to event.", GetErrorMessage(r));
	}

	r = __pCalendarbook->UpdateEvent(*__pCalEvent);
	TryCatch(!IsFailed(r), , "[%s] Failed to update the event.", GetErrorMessage(r));

	return r;

CATCH:
	int doModal;
	MessageBox messageBox;
	messageBox.Construct(L"Error", "Failed to edit the event.", MSGBOX_STYLE_OK, 0);
	messageBox.ShowAndWait(doModal);

	return r;
}