// DlgProjectMember.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
#include <algorithm>			// For reverse template.
#include "DynamicDraw.h"		// For FFGetApp().
#include "UtilStr.h"			// For FFStringToGuid.
#include "UtilMisc.h"			// For operator < (GUID, GUID)
// 06.11.16 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
#include "UtilDlg.h"			// For SetUnitString.etc.
#include "DlgInputUser.h"		// For CFCDlgInputUser.
#include "DlgProjectMember.h"	// This header.

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFCDlgProjectMember _xZkqqHx_iDfPiDeDiDeBiDiNiDeP_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::_HPCDlgProjectMember
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.10.04 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCDlgProjectMember::CFCDlgProjectMember (CWnd* pParent /*=NULL*/)
				:	BASE_CLASS(CFCDlgProjectMember::IDD, pParent),
					m_bCanModify(TRUE),				// _xZkqqHx_jFnCiPfHiJmCjEfMiCkJiBeI_xHqqkZx_
					m_guidEditorUserId(GUID_NULL),	// _xZkqqHx_jFnCiPfHiOnCiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
					m_lMemberSortColumn(0),			// _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiBeC_xHqqkZx_
					m_lMemberSortReverse(0),		// _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiCmNiLhEiDfMiBfLiDgHiCkJiBeI_xHqqkZx_
					m_lLimitedUserSortColumn(0),	// _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiBeC_xHqqkZx_
					m_lLimitedUserSortReverse(0),	// _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiCmNiLhEiDfMiBfLiDgHiCkJiBeI_xHqqkZx_
// 06.01.27 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//					m_hImageList(NULL),				// _xZkqqHx_iDiKiDfIiDgHiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDeDiDiBiBfLiDfHiDiKiDfIiDgHiBeC_xHqqkZx_
					m_hiconSortMark(NULL),			// _xZkqqHx_iDeKiDiJiDiAiCmMiDfMiBfLiDgHiDhNiBfLiDeOiBeC_xHqqkZx_
					m_hiconSortRevMark(NULL)		// _xZkqqHx_iDeKiDiJiDiAiCmMiLhEiDfMiBfLiDgHiDhNiBfLiDeOiBeC_xHqqkZx_
{
	//{{AFX_DATA_INIT(CFCDlgProjectMember)
		// _xZkqqHx_iDiBiDiC_xHqqkZx_ - ClassWizard _xZkqqHx_iCmNiClBiCmMiImKjChFiCmJiDhNiDgCiDhDiDjDiDePjHhAiCmMiDhNiDeOiDiNiCpAjCmHiJmBiCnMiClNiCmNiNoNiPjMiClFiCnMiClHiBeC_xHqqkZx_
	//}}AFX_DATA_INIT
} // CFCDlgProjectMember::CFCDlgProjectMember.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::~_HPCDlgProjectMember
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.10.04 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCDlgProjectMember::~CFCDlgProjectMember ()
{
} // CFCDlgProjectMember::~CFCDlgProjectMember.

void CFCDlgProjectMember::DoDataExchange (CDataExchange* pDX)
{
	BASE_CLASS::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFCDlgProjectMember)
		// _xZkqqHx_iDiBiDiC_xHqqkZx_ - ClassWizard _xZkqqHx_iCmNiClBiCmMiImKjChFiCmJiDhNiDgCiDhDiDjDiDePjHhAiCmMiDhNiDeOiDiNiCpAjCmHiJmBiCnMiClNiCmNiNoNiPjMiClFiCnMiClHiBeC_xHqqkZx_
	//}}AFX_DATA_MAP
} // CFCDlgProjectMember::DoDataExchange.

BEGIN_MESSAGE_MAP(CFCDlgProjectMember, BASE_CLASS)
	//{{AFX_MSG_MAP(CFCDlgProjectMember)
	ON_WM_DESTROY()
	ON_NOTIFY(LVN_COLUMNCLICK, IDC_PJM_LSV_MEMBER, OnColumnclickPjmLsvMember)
	ON_NOTIFY(LVN_ITEMCHANGED, IDC_PJM_LSV_MEMBER, OnItemchangedPjmLsvMember)
	ON_NOTIFY(LVN_COLUMNCLICK, IDC_PJM_LSV_LIMITED_USER, OnColumnclickPjmLsvLimitedUser)
	ON_NOTIFY(LVN_ITEMCHANGED, IDC_PJM_LSV_LIMITED_USER, OnItemchangedPjmLsvLimitedUser)
	ON_BN_CLICKED(IDC_PJM_BTN_ADD_USER, OnPjmBtnAddUser)
	ON_BN_CLICKED(IDC_PJM_BTN_EDIT_NAME, OnPjmBtnEditName)
	ON_BN_CLICKED(IDC_PJM_BTN_ADD_LIMITED_USER, OnPjmBtnAddLimitedUser)
	ON_BN_CLICKED(IDC_PJM_BTN_REMOVE_LIMITED_USER, OnPjmBtnRemoveLimitedUser)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFCDlgProjectMember _xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::UpdateEnable
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhLiDfOiDjDiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::UpdateEnable ()
{
	if (!m_bCanModify)
	//----- _xZkqqHx_jFnCiPfHiJmCjEfMiCmFiCmNiCmIiCkCiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_jCmHiJmBiDhLiDfOiDjDiCpAjGlDiMpIiCmJiBeC_xHqqkZx_
		GetDlgItem(IDC_PJM_BTN_ADD_USER)->EnableWindow(FALSE);
		// _xZkqqHx_jFmPiNfIiDhLiDfOiDjDiCpAjGlDiMpIiCmJiBeC_xHqqkZx_
		GetDlgItem(IDC_PJM_BTN_EDIT_NAME)->EnableWindow(FALSE);
		// _xZkqqHx_jDmHiCnNiPgPiClFiCmMiCnNiCmJjAkHiMmAiDhLiDfOiDjDiCpAjGlDiMpIiCmJiBeC_xHqqkZx_
		GetDlgItem(IDC_PJM_BTN_ADD_LIMITED_USER)->EnableWindow(FALSE);
		// _xZkqqHx_iNoNiPjMiDhLiDfOiDjDiCpAjGlDiMpIiCmJiBeC_xHqqkZx_
		GetDlgItem(IDC_PJM_BTN_REMOVE_LIMITED_USER)->EnableWindow(FALSE);
	} else
	//----- _xZkqqHx_jFnCiPfHiJmCjEfMiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_jCmHiJmBiDhLiDfOiDjDiCpAjHeMiMpIiCmJiBeC_xHqqkZx_
		GetDlgItem(IDC_PJM_BTN_ADD_USER)->EnableWindow(TRUE);
		// _xZkqqHx_iDiBiDjDiDgPiBfLiDiKiDfIiDgHiCkKjBeJjBpAiClDiCoKiCmEiCkCiCoJiCkJiBeI_xHqqkZx_
		GUID guidSelectedMemberUserId;
		BOOL bIsThereMemberSelected = GetSelectedMemberUserId(guidSelectedMemberUserId);
		// _xZkqqHx_jAkHiMmAiDiGiBfLiDfFiDiKiDfIiDgHiCkKjBeJjBpAiClDiCoKiCmEiCkCiCoJiCkJiBeI_xHqqkZx_
		GUID guidSelectedLimitedUserUserId;
		BOOL bIsThereLimitedUserSelected = GetSelectedLimitedUserUserId(guidSelectedLimitedUserUserId);
		// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCkKiCkAiCoKiCmOiBeBjFmPiNfIiDhLiDfOiDjDiCpAjHeMiMpIiCmJiBeC_xHqqkZx_
		GetDlgItem(IDC_PJM_BTN_EDIT_NAME)->EnableWindow(bIsThereMemberSelected && guidSelectedMemberUserId != GUID_NULL);
		// _xZkqqHx_jDmHiCnNiPgPiClFiCmMiCnNiCmJjAkHiMmAiDhLiDfOiDjDiCpAjAnNjCoIiBeC_xHqqkZx_
		GetDlgItem(IDC_PJM_BTN_ADD_LIMITED_USER)->EnableWindow(bIsThereMemberSelected && guidSelectedMemberUserId != m_guidEditorUserId && m_stLimitedUserList.find(guidSelectedMemberUserId) == m_stLimitedUserList.end());
		// _xZkqqHx_iNoNiPjMiDhLiDfOiDjDiCpAjAnNjCoIiBeC_xHqqkZx_
		GetDlgItem(IDC_PJM_BTN_REMOVE_LIMITED_USER)->EnableWindow(bIsThereLimitedUserSelected);
	}
} // CFCDlgProjectMember::UpdateEnable.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::GetSelectedMemberUserId
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iMlLiNnNjBeJjBpAiClDiCoKiCmEiCkCiCoJiNhDiCmMiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	guid	:_xZkqqHx_iMlLiNnNjBeJjBpAiClDiCoKiCmEiCkCiCoJiNhDiCmMiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.10.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCDlgProjectMember::GetSelectedMemberUserId (GUID& guid) const
{
	// _xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDgOiDjDiDgIiDiLiCpAiOoGjDlOiBeC_xHqqkZx_
	CListCtrl* pListView = (CListCtrl*)GetDlgItem(IDC_PJM_LSV_MEMBER);

	// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
	long lLineCount = pListView->GetItemCount();
	long lC;
	for (lC = 0; lC < lLineCount; lC++)
	{
		// _xZkqqHx_iNhDiCmMiPpDjBnEiBgJ_xHqqkZx_SELECTED_xZkqqHx_iBgKiCpAiOoGjDlOiBeC_xHqqkZx_
		UINT dwItemState = pListView->GetItemState(lC, LVIS_SELECTED);
		if (dwItemState & LVIS_SELECTED)
		//----- _xZkqqHx_jBeJjBpAiPpDjBnEiCmMiPoKiNiH_xHqqkZx_ -----
		{
			// _xZkqqHx_iDeKiDiJiDiAiCfAiCmMiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_jFlGiOjKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
			CString strUserId = pListView->GetItemText(lC, 1);
			// _xZkqqHx_iDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_jFlGiOjKjHpBiCpAiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCmJjFmPiKlHiBeC_xHqqkZx_
			if (strUserId.IsEmpty())
				guid = GUID_NULL;
			else
				guid = FFStringToGuid(TStrToWStr(strUserId));
			// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiDeBiDeDiDgFiDiAiCkKiNoNiPjMiNmPiCnNiCmMiPoKiNiHiCmN_xHqqkZx_FALSE_xZkqqHx_iBeC_xHqqkZx_
			if (m_mpMemberUserList.find(guid) == m_mpMemberUserList.end())
				return FALSE;
			return TRUE;
		}
	}
	return FALSE;
} // CFCDlgProjectMember::GetSelectedMemberUserId.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::UpdateMemberUserList
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiGiBfLiDfFiDiKiDfIiDgHiCpAjFmPiNfIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.10.04 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::UpdateMemberUserList ()
{
	// _xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDgOiDjDiDgIiDiLiCpAiOoGjDlOiBeC_xHqqkZx_
	CListCtrl* pListView = (CListCtrl*)GetDlgItem(IDC_PJM_LSV_MEMBER);

	// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	GUID guidSelectedUserId;
	BOOL bIsThereSelected = GetSelectedMemberUserId(guidSelectedUserId);
	// _xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDhHiDgCiDfPiCpAiOoGjDlOiBeC_xHqqkZx_
	CHeaderCtrl* pHeader = pListView->GetHeaderCtrl();
	// _xZkqqHx_iDeKiDiJiDiAjAjEiBeC_xHqqkZx_
	long lColumnCount = pHeader->GetItemCount();
	//----- _xZkqqHx_iDeKiDiJiDiAiCmJiDeBiDeDiDfCiDjDiCpAjAnNjCoI_xHqqkZx_ -----
	long lC;
	for (lC = 0; lC < lColumnCount; lC++)
	{
		HDITEM curItem;
		if (lC == m_lMemberSortColumn)
		//----- _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiCmMiPoKiNiH_xHqqkZx_ -----
		{
			curItem.mask = HDI_IMAGE | HDI_FORMAT;
			curItem.iImage = m_lMemberSortReverse;
			curItem.fmt = HDF_LEFT | HDF_IMAGE | HDF_STRING | HDF_BITMAP_ON_RIGHT;
		} else
		//----- _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiCmFiCmNiCmIiCkCiPoKiNiH_xHqqkZx_ -----
		{
			curItem.mask = HDI_FORMAT;
			curItem.fmt = HDF_LEFT | HDF_STRING;
		}
		pHeader->SetItem(lC, &curItem);
	}

	// _xZkqqHx_jBfDiCmEiCmMiDeBiDeDiDgFiDiAiCpAiNoNiPjMiBgJiDiMiDfCiBfLiDgIiCmNiNoNiPjMiClFiCmIiCkCiBgKiBeC_xHqqkZx_
	pListView->DeleteAllItems();

	// _xZkqqHx_iDfMiBfLiDgHiClDiCoKiClNiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_jEhKjHpBiBeC_xHqqkZx_
	vector<GUID> vSortedUserId;
	if (m_lMemberSortColumn == 0)
	//----- _xZkqqHx_iDiGiBfLiDfFjGlMiCmFiDfMiBfLiDgHiCmMiPoKiNiH_xHqqkZx_ -----
	{
		multimap<WString, GUID> mmpUserNameToUserId;
		// _xZkqqHx_iDiBiDjDiDgPiBfLiCmMiDiGiBfLiDfF_xHqqkZx_ID->_xZkqqHx_iDiGiBfLiDfFjGlMiBeC_xHqqkZx_
		GuidToUserNameMap::const_iterator iMl;
		for (iMl = m_mpMemberUserList.begin();
			 iMl != m_mpMemberUserList.end(); iMl++)
		{
			// _xZkqqHx_iDfMiBfLiDgHiClDiCoKiClNiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_jEhKjHpBiBeC_xHqqkZx_
			mmpUserNameToUserId.insert(pair<WString, GUID>((*iMl).second, (*iMl).first));
		}
		multimap<WString, GUID>::const_iterator iUn;
		for (iUn = mmpUserNameToUserId.begin(); iUn != mmpUserNameToUserId.end(); iUn++)
			vSortedUserId.push_back((*iUn).second);
	} else
	//----- _xZkqqHx_iDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCmFiDfMiBfLiDgHiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDiBiDjDiDgPiBfLiCmMiDiGiBfLiDfF_xHqqkZx_ID->_xZkqqHx_iDiGiBfLiDfFjGlMiBeC_xHqqkZx_
		GuidToUserNameMap::const_iterator iMl;
		for (iMl = m_mpMemberUserList.begin();
			 iMl != m_mpMemberUserList.end(); iMl++)
		{
			// _xZkqqHx_iDfMiBfLiDgHiClDiCoKiClNiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_jEhKjHpBiBeC_xHqqkZx_
			vSortedUserId.push_back((*iMl).first);
		}
	}
	if (m_lMemberSortReverse)
	//----- _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiCmNiLhEiDfMiBfLiDgHiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iLhEiPiHiCmJjDpMiCoKjBnGiCkGiCoJiBeC_xHqqkZx_
		reverse(vSortedUserId.begin(), vSortedUserId.end());
	}

	// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCmIiCkCiPoKiNiHiCmNiBeBiNmFiPiJiCmMiDeBiDeDiDgFiDiAiCpAjBeJjBpAiPpDjBnEiCmJiBeC_xHqqkZx_
	if (!vSortedUserId.empty() && !bIsThereSelected)
		guidSelectedUserId = vSortedUserId.front();
	long lLine;
	for (lLine = 0; lLine < vSortedUserId.size(); lLine++)
	{
		CString strUserName;
		CString strUserId;
		const GUID& guidUserId = vSortedUserId[lLine];
		if (guidUserId == GUID_NULL)
		//----- _xZkqqHx_iDfBiDfIiDgHiCmMiPoKiNiH_xHqqkZx_ -----
		{
			WString wstrUserName;
			wstrUserName.LoadString(IDS_GUEST);
			strUserName = (const _TCHAR*)WStrToTStr(wstrUserName.c_str());
		} else
		//----- _xZkqqHx_jCmKiPoNiDiGiBfLiDfFiCmMiPoKiNiH_xHqqkZx_ -----
		{
			const wchar_t* wcpUserName = m_mpMemberUserList[guidUserId].c_str();
			WString wstrGuid = FFGuidToString(guidUserId);
			WString wstrUserId;
			wstrUserId.Format(L"%s-%04X", wstrGuid.c_str(), FFGetGuidCheckCode(guidUserId));
			strUserName = (const _TCHAR*)WStrToTStr(wcpUserName);
			strUserId = (const _TCHAR*)WStrToTStr(wstrUserId);
		}
		LVITEM lvitem;
		lvitem.mask = LVIF_TEXT|LVIF_STATE;
		lvitem.iItem = lLine;
		lvitem.iSubItem = 0;
		if (guidUserId == guidSelectedUserId)
			lvitem.state = LVIS_SELECTED;
		else
			lvitem.state = 0;
		lvitem.pszText = (LPTSTR)(LPCTSTR)strUserName;
		pListView->InsertItem(&lvitem);
		pListView->SetItemText(lLine, 1, (LPTSTR)(LPCTSTR)strUserId);
	}
} // CFCDlgProjectMember::UpdateMemberUserList.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::GetSelectedLimitedUserUserId
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jAkHiMmAiDiGiBfLiDfFiDiKiDfIiDgHiCmMiBeBiMlLiNnNjBeJjBpAiClDiCoKiCmEiCkCiCoJiNhDiCmMiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	guid	:_xZkqqHx_iMlLiNnNjBeJjBpAiClDiCoKiCmEiCkCiCoJiNhDiCmMiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.10.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCDlgProjectMember::GetSelectedLimitedUserUserId (GUID& guid) const
{
	// _xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDgOiDjDiDgIiDiLiCpAiOoGjDlOiBeC_xHqqkZx_
	CListCtrl* pListView = (CListCtrl*)GetDlgItem(IDC_PJM_LSV_LIMITED_USER);
	// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
	long lLineCount = pListView->GetItemCount();
	long lC;
	for (lC = 0; lC < lLineCount; lC++)
	{
		// _xZkqqHx_iNhDiCmMiPpDjBnEiBgJ_xHqqkZx_SELECTED_xZkqqHx_iBgKiCpAiOoGjDlOiBeC_xHqqkZx_
		UINT dwItemState = pListView->GetItemState(lC, LVIS_SELECTED);
		if (dwItemState & LVIS_SELECTED)
		//----- _xZkqqHx_jBeJjBpAiPpDjBnEiCmMiPoKiNiH_xHqqkZx_ -----
		{
			// _xZkqqHx_iDeKiDiJiDiAiCfAiCmMiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_jFlGiOjKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
			CString strUserId = pListView->GetItemText(lC, 1);
			// _xZkqqHx_iDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_jFlGiOjKjHpBiCpAiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCmJjFmPiKlHiBeC_xHqqkZx_
			if (strUserId.IsEmpty())
				guid = GUID_NULL;
			else
				guid = FFStringToGuid(TStrToWStr(strUserId));
			// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiDeBiDeDiDgFiDiAiCkKiNoNiPjMiNmPiCnNiCmMiPoKiNiHiCmN_xHqqkZx_FALSE_xZkqqHx_iBeC_xHqqkZx_
			if (m_stLimitedUserList.find(guid) == m_stLimitedUserList.end())
				return FALSE;
			return TRUE;
		}
	}
	return FALSE;
} // CFCDlgProjectMember::GetSelectedLimitedUserUserId.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::UpdateLimitedUserList
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jAkHiMmAiClDiCoKiClNiDiGiBfLiDfFiCmMiDiKiDfIiDgHiCpAiNfIjAfGiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::UpdateLimitedUserList ()
{
	// _xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDgOiDjDiDgIiDiLiCpAiOoGjDlOiBeC_xHqqkZx_
	CListCtrl* pListView = (CListCtrl*)GetDlgItem(IDC_PJM_LSV_LIMITED_USER);
	// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	GUID guidSelectedUserId;
	BOOL bIsThereSelected = GetSelectedLimitedUserUserId(guidSelectedUserId);

	// _xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDhHiDgCiDfPiCpAiOoGjDlOiBeC_xHqqkZx_
	CHeaderCtrl* pHeader = pListView->GetHeaderCtrl();
	// _xZkqqHx_iDeKiDiJiDiAjAjEiBeC_xHqqkZx_
	long lColumnCount = pHeader->GetItemCount();
	//----- _xZkqqHx_iDeKiDiJiDiAiCmJiDeBiDeDiDfCiDjDiCpAjAnNjCoI_xHqqkZx_ -----
	long lC;
	for (lC = 0; lC < lColumnCount; lC++)
	{
		HDITEM curItem;
		if (lC == m_lLimitedUserSortColumn)
		//----- _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiCmMiPoKiNiH_xHqqkZx_ -----
		{
			curItem.mask = HDI_IMAGE | HDI_FORMAT;
			curItem.iImage = m_lLimitedUserSortReverse;
			curItem.fmt = HDF_LEFT | HDF_IMAGE | HDF_STRING | HDF_BITMAP_ON_RIGHT;
		} else
		//----- _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiCmFiCmNiCmIiCkCiPoKiNiH_xHqqkZx_ -----
		{
			curItem.mask = HDI_FORMAT;
			curItem.fmt = HDF_LEFT | HDF_STRING;
		}
		pHeader->SetItem(lC, &curItem);
	}

	// _xZkqqHx_jBfDiCmEiCmMiDeBiDeDiDgFiDiAiCpAiNoNiPjMiBgJiDiMiDfCiBfLiDgIiCmNiNoNiPjMiClFiCmIiCkCiBgKiBeC_xHqqkZx_
	pListView->DeleteAllItems();

	// _xZkqqHx_iDfMiBfLiDgHiClDiCoKiClNiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_jEhKjHpBiBeC_xHqqkZx_
	vector<GUID> vSortedUserId;
	if (m_lLimitedUserSortColumn == 0)
	//----- _xZkqqHx_iDiGiBfLiDfFjGlMiCmFiDfMiBfLiDgHiCmMiPoKiNiH_xHqqkZx_ -----
	{
		multimap<WString, GUID> mmpUserNameToUserId;
		// _xZkqqHx_iDiBiDjDiDgPiBfLiCmMiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
		set<GUID>::const_iterator iGid;
		for (iGid = m_stLimitedUserList.begin();
			 iGid != m_stLimitedUserList.end(); iGid++)
		{
			// _xZkqqHx_iDfMiBfLiDgHiClDiCoKiClNiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_jEhKjHpBiBeC_xHqqkZx_
			mmpUserNameToUserId.insert(pair<WString, GUID>(m_mpMemberUserList[*iGid], *iGid));
		}
		multimap<WString, GUID>::const_iterator iUn;
		for (iUn = mmpUserNameToUserId.begin(); iUn != mmpUserNameToUserId.end(); iUn++)
			vSortedUserId.push_back((*iUn).second);
	} else
	//----- _xZkqqHx_iDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCmFiDfMiBfLiDgHiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDiBiDjDiDgPiBfLiCmMiDiGiBfLiDfF_xHqqkZx_ID->_xZkqqHx_iDiGiBfLiDfFjGlMiBeC_xHqqkZx_
		set<GUID>::const_iterator iGid;
		for (iGid = m_stLimitedUserList.begin();
			 iGid != m_stLimitedUserList.end(); iGid++)
		{
			// _xZkqqHx_iDfMiBfLiDgHiClDiCoKiClNiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_jEhKjHpBiBeC_xHqqkZx_
			vSortedUserId.push_back(*iGid);
		}
	}
	if (m_lLimitedUserSortReverse)
	//----- _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiCmNiLhEiDfMiBfLiDgHiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iLhEiPiHiCmJjDpMiCoKjBnGiCkGiCoJiBeC_xHqqkZx_
		reverse(vSortedUserId.begin(), vSortedUserId.end());
	}

	// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCmIiCkCiPoKiNiHiCmNiBeBiNmFiPiJiCmMiDeBiDeDiDgFiDiAiCpAjBeJjBpAiPpDjBnEiCmJiBeC_xHqqkZx_
	if (!vSortedUserId.empty() && !bIsThereSelected)
		guidSelectedUserId = vSortedUserId.front();
	long lLine;
	for (lLine = 0; lLine < vSortedUserId.size(); lLine++)
	{
		CString strUserName;
		CString strUserId;
		const GUID& guidUserId = vSortedUserId[lLine];
		if (guidUserId == GUID_NULL)
		//----- _xZkqqHx_iDfBiDfIiDgHiCmMiPoKiNiH_xHqqkZx_ -----
		{
			WString wstrUserName;
			wstrUserName.LoadString(IDS_GUEST);
			strUserName = (const _TCHAR*)WStrToTStr(wstrUserName.c_str());
		} else
		//----- _xZkqqHx_jCmKiPoNiDiGiBfLiDfFiCmMiPoKiNiH_xHqqkZx_ -----
		{
			const wchar_t* wcpUserName = m_mpMemberUserList[guidUserId].c_str();
			WString wstrGuid = FFGuidToString(guidUserId);
			WString wstrUserId;
			wstrUserId.Format(L"%s-%04X", wstrGuid.c_str(), FFGetGuidCheckCode(guidUserId));
			strUserName = (const _TCHAR*)WStrToTStr(wcpUserName);
			strUserId = (const _TCHAR*)WStrToTStr(wstrUserId);
		}
		LVITEM lvitem;
		lvitem.mask = LVIF_TEXT|LVIF_STATE;
		lvitem.iItem = lLine;
		lvitem.iSubItem = 0;
		if (guidUserId == guidSelectedUserId)
			lvitem.state = LVIS_SELECTED;
		else
			lvitem.state = 0;
		lvitem.pszText = (LPTSTR)(LPCTSTR)strUserName;
		pListView->InsertItem(&lvitem);
		pListView->SetItemText(lLine, 1, (LPTSTR)(LPCTSTR)strUserId);
	}
} // CFCDlgProjectMember::UpdateLimitedUserList.

/////////////////////////////////////////////////////////////////////////////
// CFCDlgProjectMember _xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiJ_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::OnInitDialog
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiPiJiKpKiJlLiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pNewjdlg	:_xZkqqHx_iDfPiDeDiDeBiDiNiDePiPoOjFpBiNfMjBkCjBmMiCpAiOhHjCoIiBeC_xHqqkZx_
 *			hwndDlg		:_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDeFiDeCiDjDiDgIiDeFiDgOiDjDiDgIiDiLiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.10.04 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCDlgProjectMember::OnInitDialog ()
{
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnInitDialog();

	// _xZkqqHx_iDiKiDfIiDgHiDfCiDjDiDgHiDiNiBfLiDiLiDhHiDgCiDfPiCmMiDeDiDiBiBfLiDfHiDiKiDfIiDgHiCpAiNoMjAkMiBeC_xHqqkZx_
	m_imageList.Create(10, 10, ILC_MASK, 2, 2);
	// _xZkqqHx_iDeKiDiJiDiAiCmMiDfMiBfLiDgHiDhNiBfLiDeOiDeBiDeDiDfCiDjDiBeC_xHqqkZx_
	m_hiconSortMark = FFGetApp()->LoadIcon(IDI_SORT_MARK);
	// _xZkqqHx_iDeKiDiJiDiAiCmMiLhEiDfMiBfLiDgHiDhNiBfLiDeOiDeBiDeDiDfCiDjDiBeC_xHqqkZx_
	m_hiconSortRevMark = FFGetApp()->LoadIcon(IDI_SORT_REV_MARK);
	// _xZkqqHx_iDeDiDiBiBfLiDfHiDiKiDfIiDgHiCmJiDeDiDiBiBfLiDfHiBgJiDeBiDeDiDfCiDjDiBgKiCpAjCmHiJmBiBeC_xHqqkZx_
	m_imageList.Add(m_hiconSortMark);
	m_imageList.Add(m_hiconSortRevMark);

	CString tstrCaptionUserName;
	CString tstrCaptionUserId;
	tstrCaptionUserId.LoadString(IDS_USER_ID);
	tstrCaptionUserName.LoadString(IDS_USER_NAME);

	const int ids[] = { IDC_PJM_LSV_MEMBER, IDC_PJM_LSV_LIMITED_USER };
	for (int iC = 0; iC != sizeof(ids) / sizeof(ids[0]); iC++)
	{
		// _xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDgOiDjDiDgIiDiLiCpAiOoGjDlOiBeC_xHqqkZx_
		CListCtrl* pListView = (CListCtrl*)GetDlgItem(ids[iC]);

		// _xZkqqHx_jBfDiNhDiCkKjBeJjBpAiClDiCoKiCoJiCoGiCkEiCmJiBeC_xHqqkZx_
		pListView->SetExtendedStyle(
							pListView->GetExtendedStyle()|LVS_EX_FULLROWSELECT);
		// _xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDhHiDgCiDfPiCpAiOoGjDlOiBeC_xHqqkZx_
		CHeaderCtrl* pHeader = pListView->GetHeaderCtrl();
		// _xZkqqHx_iDeDiDiBiBfLiDfHiDiKiDfIiDgHiCpAiDhHiDgCiDfPiCmJjAnNjCoIiBeC_xHqqkZx_
		pHeader->SetImageList(&m_imageList);
		// _xZkqqHx_iDeKiDiJiDiAiCpAjCmHiJmBiBeC_xHqqkZx_
		RECT rtClient;
		GetClientRect(&rtClient);
		long lWidth = rtClient.right - rtClient.left;

		LVCOLUMN lvcolumn;
		lvcolumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
		lvcolumn.fmt = LVCFMT_LEFT;
		lvcolumn.cx = lWidth * 1 / 3;
		lvcolumn.pszText = (LPTSTR)(const _TCHAR*)tstrCaptionUserName;
		lvcolumn.cchTextMax = 0;
		pListView->InsertColumn(0, &lvcolumn);
		lvcolumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
		lvcolumn.fmt = LVCFMT_LEFT;
		lvcolumn.cx = lWidth - (lWidth * 1 / 3);
		lvcolumn.pszText = (LPTSTR)(const _TCHAR*)tstrCaptionUserId;
		lvcolumn.cchTextMax = 0;
		pListView->InsertColumn(1, &lvcolumn);
	}
//----- 05.10.21 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	if (!m_bCanModify)
//	//----- _xZkqqHx_jFnCiPfHiJmCjEfMiCmFiCmNiCmIiCkCiPoKiNiH_xHqqkZx_ -----
//	{
//		// _xZkqqHx_jFmPiNfIiDhLiDfOiDjDiCpAjGlDiMpIiCmJiBeC_xHqqkZx_
//		EnableWindow(GetDlgItem(m_hWnd, IDC_PJM_BTN_EDIT_NAME), FALSE);
//		// _xZkqqHx_iNoNiPjMiDhLiDfOiDjDiCpAjGlDiMpIiCmJiBeC_xHqqkZx_
//		EnableWindow(GetDlgItem(m_hWnd, IDC_PJM_BTN_REMOVE_LIMITED_USER), FALSE);
//	}
//----- 05.10.21 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_iDiGiBfLiDfFiDiKiDfIiDgHiCpAiNfIjAfGiBeC_xHqqkZx_
	UpdateMemberUserList();
	UpdateLimitedUserList();
	// _xZkqqHx_iDhLiDfOiDjDiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoIiBeC_xHqqkZx_
	UpdateEnable();

//----- 06.11.16 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMjCfAiImKjFfMiOkGiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
	::SetUnitString(m_hWnd);
	// _xZkqqHx_jHjIiCkLjIhCjBmOiJjOjFlGiOjKjHpBiCmMjAnNjCoIiCpAiNhDiCkEiBeC_xHqqkZx_
	::RightByLeftHand(m_hWnd);
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCpAiDhNiDeFiDfIiImKjChFiCmJiInKjDkOiBeC_xHqqkZx_
	::FFJustifyWindow(m_hWnd);
//----- 06.11.16 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

	return TRUE;	// _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCmJiDhEiDeIiBfLiDeKiDfIiCpAjAnNjCoIiClFiCmIiCkCiCmGiCkLiBeBjGnPiCoIjCgMiCmN_xHqqkZx_ TRUE _xZkqqHx_iCmGiCmIiCoIiCnMiClH_xHqqkZx_
					// _xZkqqHx_jHoBiKeP_xHqqkZx_: OCX _xZkqqHx_iDhGiDiNiDhAiDgFiDeC_xHqqkZx_ _xZkqqHx_iDhJiBfLiDfHiCmMjGnPiCoIjCgMiCmN_xHqqkZx_ FALSE _xZkqqHx_iCmGiCmIiCoIiCnMiClH_xHqqkZx_
} // CFCDlgProjectMember::OnInitDialog.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::OnDestroy
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiNoNiPjMiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.10.04 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::OnDestroy ()
{
	// _xZkqqHx_iDiKiDfIiDgHiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDeDiDiBiBfLiDfHiDiKiDfIiDgHiBeC_xHqqkZx_
	m_imageList.DeleteImageList();
	// _xZkqqHx_iDeKiDiJiDiAiCmMiDfMiBfLiDgHiDhNiBfLiDeOiDeBiDeDiDfCiDjDiBeC_xHqqkZx_
	DestroyIcon(m_hiconSortMark);
	// _xZkqqHx_iDeKiDiJiDiAiCmMiLhEiDfMiBfLiDgHiDhNiBfLiDeOiDeBiDeDiDfCiDjDiBeC_xHqqkZx_
	DestroyIcon(m_hiconSortRevMark);
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnDestroy();
} // CFCDlgProjectMember::OnDestroy.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::OnOK
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	OK_xZkqqHx_iDhLiDfOiDjDiCkKiJjPiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pNewjdlg	:_xZkqqHx_iDfPiDeDiDeBiDiNiDePiPoOjFpBiNfMjBkCjBmMiCpAiOhHjCoIiBeC_xHqqkZx_
 *			m_hWnd		:_xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMiDeFiDeCiDjDiDgIiDeFiDgOiDjDiDgIiDiLiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.10.04 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::OnOK ()
{
	if (!m_bCanModify)
	//----- _xZkqqHx_jFnCiPfHiJmCjEfMiCmFiCmNiCmIiCkCiPoKiNiH_xHqqkZx_ -----
	{
		// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
		BASE_CLASS::OnCancel();
	} else
	//----- _xZkqqHx_jFnCiPfHiJmCjEfMiCmIiPoKiNiH_xHqqkZx_ -----
	{
		// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
		BASE_CLASS::OnOK();
	}
} // CFCDlgProjectMember::OnOK.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::OnColumnclickPjmLsvMember
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiCmMiDeKiDiJiDiAiCkKiDeOiDiKiDgCiDeOiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pMNListView	:_xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiCmMiDeOiDiKiDgCiDeOiClDiCoKiClNiPoOjFpBiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::OnColumnclickPjmLsvMember (NMHDR* pNMHDR, LRESULT* pResult)
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	// _xZkqqHx_iMlLiNnNiDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiCpAiDeOiDiKiDgCiDeOiClFiClNiPoKiNiHiCmNiBeBiDfMiBfLiDgHiCpAiLhEiPiHiCmJiBeC_xHqqkZx_
	if (m_lMemberSortColumn == pNMListView->iSubItem)
	{
		m_lMemberSortReverse = !m_lMemberSortReverse;
	} else
	{
		// _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiBeC_xHqqkZx_
		m_lMemberSortColumn = pNMListView->iSubItem;
		m_lMemberSortReverse = 0;
	}
	// _xZkqqHx_iDiGiBfLiDfFiDiKiDfIiDgHiCpAjFmPiNfIiClHiCoJiBeC_xHqqkZx_
	UpdateMemberUserList();
	// _xZkqqHx_iDhLiDfOiDjDiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoIiBeC_xHqqkZx_
	UpdateEnable();

	*pResult = 0;
} // CFCDlgProjectMember::OnColumnclickPjmLsvMember.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::OnItemchangedPjmLsvMember
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiCmMiDeBiDeDiDgFiDiAiCkKjBeJjBpAjFmPiNfIjDjJiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pMNListView	:_xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiCmMiDeOiDiKiDgCiDeOiClDiCoKiClNiPoOjFpBiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::OnItemchangedPjmLsvMember (NMHDR* pNMHDR, LRESULT* pResult)
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;

	// _xZkqqHx_iDhLiDfOiDjDiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoIiBeC_xHqqkZx_
	UpdateEnable();

	*pResult = 0;
} // CFCDlgProjectMember::OnItemchangedPjmLsvMember.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::OnColumnclickPjmLsvLimitedUser
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jAkHiMmAiClDiCoKiClNiDiGiBfLiDfFiCmMiDiKiDfIiDgHiDhCiDiFiBfLiCmMiDeKiDiJiDiAiCkKiDeOiDiKiDgCiDeOiClDiCoKiClNiCmGiCkLiCmJ_xHqqkZx_
 *			_xZkqqHx_iOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pMNListView	:_xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiCmMiDeOiDiKiDgCiDeOiClDiCoKiClNiPoOjFpBiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::OnColumnclickPjmLsvLimitedUser (NMHDR* pNMHDR, LRESULT* pResult)
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	// _xZkqqHx_iMlLiNnNiDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiCpAiDeOiDiKiDgCiDeOiClFiClNiPoKiNiHiCmNiBeBiDfMiBfLiDgHiCpAiLhEiPiHiCmJiBeC_xHqqkZx_
	if (m_lLimitedUserSortColumn == pNMListView->iSubItem)
	{
		m_lLimitedUserSortReverse = !m_lLimitedUserSortReverse;
	} else
	{
		// _xZkqqHx_iDfMiBfLiDgHjCiGiCmMiDeKiDiJiDiAiBeC_xHqqkZx_
		m_lLimitedUserSortColumn = pNMListView->iSubItem;
		m_lLimitedUserSortReverse = 0;
	}
	// _xZkqqHx_iDiGiBfLiDfFiDiKiDfIiDgHiCpAjFmPiNfIiClHiCoJiBeC_xHqqkZx_
	UpdateLimitedUserList();
	// _xZkqqHx_iDhLiDfOiDjDiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoIiBeC_xHqqkZx_
	UpdateEnable();

	*pResult = 0;
} // CFCDlgProjectMember::OnColumnclickPjmLsvLimitedUser.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::OnItemchangedPjmLsvLimitedUser
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jAkHiMmAiClDiCoKiClNiDiGiBfLiDfFiCmMiDiKiDfIiDgHiDhCiDiFiBfLiCmMiDeBiDeDiDgFiDiAiCkKjBeJjBpAjFmPiNfIjDjJiClDiCoKiClN_xHqqkZx_
 *			_xZkqqHx_iCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pMNListView	:_xZkqqHx_iDiKiDfIiDgHiDhCiDiFiBfLiCmMiDeOiDiKiDgCiDeOiClDiCoKiClNiPoOjFpBiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::OnItemchangedPjmLsvLimitedUser (NMHDR* pNMHDR, LRESULT* pResult)
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;

	// _xZkqqHx_iDhLiDfOiDjDiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoIiBeC_xHqqkZx_
	UpdateEnable();

	*pResult = 0;
} // CFCDlgProjectMember::OnItemchangedPjmLsvLimitedUser.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::OnPjmBtnAddUser
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iBhFjCmHiJmBiBhGiDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::OnPjmBtnAddUser ()
{
	// _xZkqqHx_iDiGiBfLiDfFjDpMjHmNiDfPiDeDiDeBiDiNiDePiBeC_xHqqkZx_
	CFCDlgInputUser dlg;
	//----- _xZkqqHx_iKpJiCmJjDgPjIfOiClDiCoKiCmEiCkCiCoJiDiBiDjDiDgPiBfLiCmMiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCmGiDiGiBfLiDfFjGlMiCpAjAnNjCoI_xHqqkZx_ -----
	GuidToUserNameMap::const_iterator iMl;
	for (iMl = m_mpMemberUserList.begin();
		 iMl != m_mpMemberUserList.end(); iMl++)
	{
		dlg.m_stUsedUserId.insert((*iMl).first);
		dlg.m_stUsedUserName.insert((*iMl).second);
	}
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCpAjFfMiOkGiBeC_xHqqkZx_
	if (dlg.DoModal() == IDOK)
	//----- OK_xZkqqHx_iDhLiDfOiDjDiCmFiPeJjHlJiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDiGiBfLiDfFiCpAjCmHiJmBiBeC_xHqqkZx_
		m_mpMemberUserList[dlg.m_guidUserId] = dlg.m_wstrUserName;
		// _xZkqqHx_iDiGiBfLiDfFiDiKiDfIiDgHiCpAjFmPiNfIiClHiCoJiBeC_xHqqkZx_
		UpdateMemberUserList();
		// _xZkqqHx_iDhLiDfOiDjDiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoIiBeC_xHqqkZx_
		UpdateEnable();
	}
} // CFCDlgProjectMember::OnPjmBtnAddUser.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::OnPjmBtnEditName
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iBhFjFmPiNfIiBhGiDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::OnPjmBtnEditName ()
{
	// _xZkqqHx_iDiGiBfLiDfFjDpMjHmNiDfPiDeDiDeBiDiNiDePiBeC_xHqqkZx_
	CFCDlgInputUser dlg;
	// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	GUID guidSelectedUserId;
	BOOL bIsThereSelected = GetSelectedMemberUserId(guidSelectedUserId);
	// GUEST_xZkqqHx_iCmMiPoKiNiHiCmNjFjMiLeBiBeC_xHqqkZx_
	if (!bIsThereSelected || guidSelectedUserId == GUID_NULL) return;
	// _xZkqqHx_iDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	dlg.m_guidUserId = guidSelectedUserId;
	// _xZkqqHx_iDiGiBfLiDfFjGlMiBeC_xHqqkZx_
	dlg.m_wstrUserName = (*m_mpMemberUserList.find(guidSelectedUserId)).second;
	//----- _xZkqqHx_iKpJiCmJjDgPjIfOiClDiCoKiCmEiCkCiCoJiDiBiDjDiDgPiBfLiCmMiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCmGiDiGiBfLiDfFjGlMiCpAjAnNjCoI_xHqqkZx_ -----
	GuidToUserNameMap::const_iterator iMl;
	for (iMl = m_mpMemberUserList.begin();
		 iMl != m_mpMemberUserList.end(); iMl++)
	{
		if ((*iMl).first != dlg.m_guidUserId)
		//----- _xZkqqHx_jFmPiNfIjBmOiPnLiCmMiDiGiBfLiDfFiImIiKePiCpAjAnNjCoI_xHqqkZx_ -----
		{
			dlg.m_stUsedUserId.insert((*iMl).first);
			dlg.m_stUsedUserName.insert((*iMl).second);
		}
	}
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCpAjFfMiOkGiBeC_xHqqkZx_
	if (dlg.DoModal() == IDOK)
	//----- OK_xZkqqHx_iDhLiDfOiDjDiCmFiPeJjHlJiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDiGiBfLiDfFjGlMiCpAjFmPiNfIiBeC_xHqqkZx_
		m_mpMemberUserList[guidSelectedUserId] = dlg.m_wstrUserName;
		// _xZkqqHx_iDiGiBfLiDfFiDiKiDfIiDgHiCpAjFmPiNfIiClHiCoJiBeC_xHqqkZx_
		UpdateMemberUserList();
		UpdateLimitedUserList();
		// _xZkqqHx_iDhLiDfOiDjDiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoIiBeC_xHqqkZx_
		UpdateEnable();
	}
} // CFCDlgProjectMember::OnPjmBtnEditName.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::OnPjmBtnAddLimitedUser
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iBhFjDmHiCnNiPgPiClFiCmMiCnNiCmJjAkHiMmAiBhGiDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::OnPjmBtnAddLimitedUser ()
{
	// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	GUID guidSelectedUserId;
	BOOL bIsThereSelected = GetSelectedMemberUserId(guidSelectedUserId);
	// _xZkqqHx_jGkCjBeJjBpAiCmMiPoKiNiHiCmNjFjMiLeBiBeC_xHqqkZx_
	if (!bIsThereSelected) return;
	// _xZkqqHx_iDiGiBfLiDfFjGlMiCpAjAkHiMmAiDiGiBfLiDfFiCmJjDgPjIfOiBeC_xHqqkZx_
	m_stLimitedUserList.insert(guidSelectedUserId);
	// _xZkqqHx_iDiGiBfLiDfFiDiKiDfIiDgHiCpAjFmPiNfIiClHiCoJiBeC_xHqqkZx_
	UpdateLimitedUserList();
	// _xZkqqHx_iDhLiDfOiDjDiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoIiBeC_xHqqkZx_
	UpdateEnable();
} // CFCDlgProjectMember::OnPjmBtnAddLimitedUser.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProjectMember::OnPjmBtnRemoveLimitedUser
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iBhFiNoNiPjMiBhGiDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProjectMember::OnPjmBtnRemoveLimitedUser ()
{
	// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	GUID guidSelectedUserId;
	BOOL bIsThereSelected = GetSelectedLimitedUserUserId(guidSelectedUserId);
	// _xZkqqHx_jGkCjBeJjBpAiCmMiPoKiNiHiCmNjFjMiLeBiBeC_xHqqkZx_
	if (!bIsThereSelected) return;
	// _xZkqqHx_jAkHiMmAiDiGiBfLiDfFiCkJiCoHiClDiLoMiPjMiBeC_xHqqkZx_
	m_stLimitedUserList.erase(guidSelectedUserId);
	// _xZkqqHx_iDiGiBfLiDfFiDiKiDfIiDgHiCpAjFmPiNfIiClHiCoJiBeC_xHqqkZx_
	UpdateLimitedUserList();
	// _xZkqqHx_iDhLiDfOiDjDiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoIiBeC_xHqqkZx_
	UpdateEnable();
} // CFCDlgProjectMember::OnPjmBtnRemoveLimitedUser.

