Ejemplo n.º 1
0
void CxDlgIceProfile::OnOK() 
{
	CString csMsg;
	ICEPROFILEDATA ProfileInfoNew;

	memset(&ProfileInfoNew,0,sizeof(ICEPROFILEDATA));

	if (!UpdateData(TRUE)) // Verify validation for m_lTimeOut value.
		return;

	if ( FillstructureFromCtrl(&ProfileInfoNew) == FALSE)
		return;

	if (!m_pStructProfileInfo->bAlter)
	{
		if (ICEAddobject((LPUCHAR)(LPCTSTR)m_csVnodeName ,OT_ICE_PROFILE,&ProfileInfoNew ) == RES_ERR)
		{
			csMsg.LoadString(IDS_E_ICE_ADD_PROFILE);
			MessageWithHistoryButton(m_hWnd,csMsg);
			return;
		}
	}
	else
	{
		if ( ICEAlterobject((LPUCHAR)(LPCTSTR)m_csVnodeName,OT_ICE_PROFILE, m_pStructProfileInfo, &ProfileInfoNew ) == RES_ERR )
		{
			csMsg.LoadString(IDS_E_ICE_ALTER_PROFILE);
			MessageWithHistoryButton(m_hWnd,csMsg);
			return;
		}

	}
	CDialog::OnOK();
}
Ejemplo n.º 2
0
void CxDlgIceDbUser::OnOK() 
{
	CString csMsg;
	ICEDBUSERDATA StructDbUserNew;

	memset(&StructDbUserNew,0,sizeof(ICEDBUSERDATA));
	UpdateData(TRUE);

	if ( m_csPassword != m_csConfirm )
	{
		AfxMessageBox (IDS_E_PLEASE_RETYPE_PASSWORD);
		m_csPassword = _T("");
		m_csConfirm = _T("");
		UpdateData(FALSE);
		return;
	}

	if ( FillstructureFromCtrl(&StructDbUserNew) == FALSE )
		return;
	if (!m_pStructDbUser->bAlter)
	{
		if ( ICEAddobject((LPUCHAR)(LPCTSTR)m_csVirtNodeName ,OT_ICE_DBUSER,&StructDbUserNew ) == RES_ERR )
		{
			csMsg.LoadString(IDS_E_ICE_ADD_DATABASE_USER_FAILED);
			MessageWithHistoryButton(m_hWnd,csMsg);
			return;
		}
	}
	else
	{
		if ( ICEAlterobject((LPUCHAR)(LPCTSTR)m_csVirtNodeName,OT_ICE_DBUSER, m_pStructDbUser, &StructDbUserNew ) == RES_ERR )
		{
			csMsg.LoadString(IDS_E_ICE_ALTER_DATABASE_USER_FAILED);
			MessageWithHistoryButton(m_hWnd,csMsg);
			return;
		}
	}
	CDialog::OnOK();
}